Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Feb 4, 2021
1 parent d9ef855 commit fc9433f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/watchCases/cache/asset-modules/0/file.txt
@@ -0,0 +1 @@
Hello World
14 changes: 14 additions & 0 deletions test/watchCases/cache/asset-modules/0/index.js
@@ -0,0 +1,14 @@
it("should return a valid url when cached", () => {
const url = new URL("file.txt", import.meta.url);
expect(url.pathname).toMatch(/\.txt$/);
});

it("should return a valid url when modified", () => {
const url = new URL("other.txt", import.meta.url);
expect(url.pathname).toMatch(/\.txt$/);
});

it("should not emit undefined files", () => {
expect(STATS_JSON.assets.map(a => a.name)).not.toContain(undefined);
expect(STATS_JSON.assets.map(a => a.name)).not.toContain("undefined");
});
1 change: 1 addition & 0 deletions test/watchCases/cache/asset-modules/0/other.txt
@@ -0,0 +1 @@
Hello World 2
1 change: 1 addition & 0 deletions test/watchCases/cache/asset-modules/1/file.txt
@@ -0,0 +1 @@
Hello World
1 change: 1 addition & 0 deletions test/watchCases/cache/asset-modules/1/other.txt
@@ -0,0 +1 @@
Hello World 3

0 comments on commit fc9433f

Please sign in to comment.