Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,18 @@ describe('E2E test - Switcher offline - Snapshot:', function () {
requestGetStub.returns(Promise.resolve({ status: false })); // Snapshot outdated
requestPostStub.returns(Promise.resolve(JSON.stringify(JSON.parse(dataJSON), null, 4)));
// Mocking finishes

switcher = new Switcher(url, apiKey, domain, component, environment, {
snapshotLocation: 'generated-snapshots/',
snapshotAutoload: true,
offline: true
});

await switcher.loadSnapshot();
assert.isTrue(await switcher.checkSnapshot());

switcher.unloadSnapshot();
fs.unlinkSync(`generated-snapshots/${environment}.json`);
});

it('should NOT update snapshot', async function () {
Expand Down