@@ -464,4 +464,64 @@ describe('basic', function () {
464464 expect ( response ) . to . eql ( undefined ) ;
465465 } ) ;
466466 } ) ;
467+
468+ it ( 'epicgames.com - should return og data using a header' , function ( ) {
469+ return ogs ( {
470+ url : 'https://dev.epicgames.com/documentation/ja-jp/unreal-engine/volume-actors-in-unreal-engine' ,
471+ fetchOptions : {
472+ headers : {
473+ 'user-agent' : 'Twitterbot' ,
474+ Origin : 'https://dev.epicgames.com/documentation/ja-jp/unreal-engine/volume-actors-in-unreal-engine' ,
475+ } ,
476+ } ,
477+ } )
478+ . then ( function ( { error, result, response } ) {
479+ console . log ( 'error:' , error ) ;
480+ console . log ( 'result:' , result ) ;
481+ expect ( error ) . to . be . eql ( false ) ;
482+ expect ( result . ogSiteName ) . to . be . eql ( 'Epic Games Developer' ) ;
483+ expect ( result . ogDescription ) . to . be . eql ( 'Unreal Engine でのさまざまな種類の Volume アクタのリファレンス' ) ;
484+ expect ( result . ogTitle ) . to . be . eql ( 'Unreal Engine での Volume アクタ | Unreal Engine 5.4 ドキュメンテーション | Epic Developer Community' ) ;
485+ expect ( result . ogType ) . to . be . eql ( 'website' ) ;
486+ expect ( result . ogUrl ) . to . be . eql ( 'https://dev.epicgames.com/documentation/ja-jp/unreal-engine/volume-actors-in-unreal-engine' ) ;
487+ expect ( result . twitterCard ) . to . be . eql ( 'summary_large_image' ) ;
488+ expect ( result . twitterTitle ) . to . be . eql ( 'Unreal Engine での Volume アクタ | Unreal Engine 5.4 ドキュメンテーション | Epic Developer Community' ) ;
489+ expect ( result . twitterDescription ) . to . be . eql ( 'Unreal Engine でのさまざまな種類の Volume アクタのリファレンス' ) ;
490+ expect ( result . twitterSite ) . to . be . eql ( '@UnrealEngine' ) ;
491+ expect ( result . ogImage ) . to . be . eql ( [
492+ {
493+ height : '630' ,
494+ url : 'https://dev.epicgames.com/community/api/documentation/image/meta_tag?path=ja-jp/unreal-engine/volume-actors-in-unreal-engine&application_version=5.4' ,
495+ width : '1200' ,
496+ } ,
497+ ] ) ;
498+ expect ( result . twitterImage ) . to . be . eql ( [
499+ {
500+ url : 'https://dev.epicgames.com/community/api/documentation/image/meta_tag?path=ja-jp/unreal-engine/volume-actors-in-unreal-engine&application_version=5.4' ,
501+ } ,
502+ ] ) ;
503+ expect ( result . favicon ) . to . be . eql ( 'https://edc-cdn.net/assets/images/favicon-light.png' ) ;
504+ expect ( result . charset ) . to . be . eql ( 'utf-8' ) ;
505+ expect ( result . requestUrl ) . to . be . eql ( 'https://dev.epicgames.com/documentation/ja-jp/unreal-engine/volume-actors-in-unreal-engine' ) ;
506+ expect ( result . success ) . to . be . eql ( true ) ;
507+ expect ( result ) . to . have . all . keys (
508+ 'ogSiteName' ,
509+ 'ogDescription' ,
510+ 'ogTitle' ,
511+ 'ogType' ,
512+ 'ogUrl' ,
513+ 'twitterCard' ,
514+ 'twitterTitle' ,
515+ 'twitterDescription' ,
516+ 'twitterSite' ,
517+ 'ogImage' ,
518+ 'twitterImage' ,
519+ 'favicon' ,
520+ 'charset' ,
521+ 'requestUrl' ,
522+ 'success' ,
523+ ) ;
524+ expect ( response ) . to . be . an ( 'Response' ) ;
525+ } ) ;
526+ } ) ;
467527} ) ;
0 commit comments