Synchronize verified assets incrementally and guard update activation
This commit is contained in:
@@ -60,3 +60,11 @@ test('rollback retains legacy tag algorithm and relative-only single-tag stampin
|
||||
expect(result.manifest.buildTag).toBe(expected.digest('hex').slice(0, 12));
|
||||
expect(result.index).toContain('href="/app.css"');
|
||||
}));
|
||||
|
||||
test('sync rollback changes build identity and injected worker byte hash', () => fixture(dir => {
|
||||
writeFileSync(join(dir,'sw.js'), "const VERSION = typeof __BUILD_TAG__ !== 'undefined' ? __BUILD_TAG__ : 'old'; const SYNC = typeof __ASSET_SYNC__ !== 'undefined' ? __ASSET_SYNC__ : true;");
|
||||
const on=createAssetManifest(dir),off=createAssetManifest(dir,{assetSync:false});
|
||||
expect(on.sw).toContain('const SYNC = true');expect(off.sw).toContain('const SYNC = false');
|
||||
expect(on.manifest.buildTag).not.toBe(off.manifest.buildTag);
|
||||
expect(off.manifest.files['/sw.js'].h).toBe(hash(off.sw));
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user