Skip to content

Commit 9e690c5

Browse files
committed
fix: tests
1 parent 1d5a7ad commit 9e690c5

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

test/fixtures/rev-manifest.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
"script.js": {
77
"path": "script-d80c4dea53.js",
88
"integrity": "sha256-YEWYfCFP9yc5DAF8K5AtLEyFuKZ1MNw+xQPm8g70LYY="
9+
},
10+
"fakescript.js": {
11+
"path": "fakescript-d80c4dea53.js",
12+
"random": "test"
913
}
1014
}

test/test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ test('returns output of integrity when manifest invoked with new format', t => {
4747
);
4848
});
4949

50+
test('returns output false when manifest invoked with unknown file', t => {
51+
const manifest = path.join(__dirname, 'fixtures', 'rev-manifest.json');
52+
t.is(manifestRev({ manifest })('fakescript.js', 'integrity'), false);
53+
});
54+
55+
test('returns output false when manifest invoked with unknown property', t => {
56+
const manifest = path.join(__dirname, 'fixtures', 'rev-manifest.json');
57+
t.is(manifestRev({ manifest })('fakescript.js', 'random'), false);
58+
});
59+
5060
test('returns output of integrity when manifest invoked in PROD with new format', t => {
5161
const manifest = path.join(__dirname, 'fixtures', 'rev-manifest.json');
5262
process.env.NODE_ENV = 'production';

0 commit comments

Comments
 (0)