@@ -2,6 +2,7 @@ import * as nock from 'nock';
2
2
import OtaClient , { Manifest } from '../src/index' ;
3
3
4
4
describe ( 'OTA client' , ( ) => {
5
+ const now = Date . now ( ) ;
5
6
let scope : nock . Scope ;
6
7
const languageCode = 'uk' ;
7
8
const hash = 'testHash' ;
@@ -13,7 +14,7 @@ describe('OTA client', () => {
13
14
const manifest : Manifest = {
14
15
files : [ filePath ] ,
15
16
languages : [ languageCode ] ,
16
- timestamp : Date . now ( ) ,
17
+ timestamp : now ,
17
18
} ;
18
19
const jsonFilePath1 = '/folder/file1.json' ;
19
20
const jsonFilePath2 = '/folder/file2.json' ;
@@ -30,7 +31,7 @@ describe('OTA client', () => {
30
31
const manifestWithJsonFiles : Manifest = {
31
32
files : [ jsonFilePath1 , jsonFilePath2 ] ,
32
33
languages : [ languageCode ] ,
33
- timestamp : Date . now ( ) ,
34
+ timestamp : now ,
34
35
} ;
35
36
36
37
beforeAll ( ( ) => {
@@ -62,6 +63,12 @@ describe('OTA client', () => {
62
63
expect ( client . getCurrentLocale ( ) ) . toBe ( languageCode ) ;
63
64
} ) ;
64
65
66
+ it ( 'should return manifest timestamp' , async ( ) => {
67
+ const timestamp = await client . getManifestTimestamp ( ) ;
68
+ expect ( timestamp ) . toEqual ( manifest . timestamp ) ;
69
+ expect ( timestamp ) . toEqual ( now ) ;
70
+ } ) ;
71
+
65
72
it ( 'should return list of files from manifest' , async ( ) => {
66
73
const files = await client . listFiles ( ) ;
67
74
expect ( files ) . toEqual ( manifest . files ) ;
0 commit comments