Skip to content

Commit 628af36

Browse files
committed
chore: adding tests.
1 parent ac9ecbb commit 628af36

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

packages/wxt/e2e/tests/zip.test.ts

+22
Original file line numberDiff line numberDiff line change
@@ -285,4 +285,26 @@ describe('Zipping', () => {
285285
expect(await project.fileExists(sourcesZip)).toBe(false);
286286
},
287287
);
288+
289+
it('exclude files in .zip except those with a bang !', async () => {
290+
const project = new TestProject({
291+
name: 'test',
292+
version: '1.0.0',
293+
});
294+
project.addFile(
295+
'entrypoints/background.ts',
296+
'export default defineBackground(() => {});',
297+
);
298+
const unzipDir = project.resolvePath('.output/test-1.0.0-chrome');
299+
const sourcesZip = project.resolvePath('.output/test-1.0.0-chrome.zip');
300+
301+
await project.zip({
302+
zip: {
303+
exclude: ['**/*.json', '!manifest.json'],
304+
},
305+
});
306+
307+
await extract(sourcesZip, { dir: unzipDir });
308+
expect(await project.fileExists(unzipDir, 'manifest.json')).toBe(true);
309+
});
288310
});

0 commit comments

Comments
 (0)