Skip to content

Commit

Permalink
test: added
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed May 28, 2023
1 parent 2a8ba54 commit d106790
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/__snapshots__/loader.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,15 @@ exports[`loader should resolve unresolved url with alias: errors 1`] = `[]`;

exports[`loader should resolve unresolved url with alias: warnings 1`] = `[]`;

exports[`loader should throw an error: errors 1`] = `
[
"ModuleBuildError: Module build failed (from \`replaced original path\`):
",
]
`;

exports[`loader should throw an error: warnings 1`] = `[]`;

exports[`loader should transform urls: css 1`] = `
".img4 {
background: url(folder/img.jpg);
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/broken.less
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
broken;
9 changes: 9 additions & 0 deletions test/loader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -991,4 +991,13 @@ describe("loader", () => {
expect(getWarnings(stats)).toMatchSnapshot("warnings");
expect(getErrors(stats)).toMatchSnapshot("errors");
});

it("should throw an error", async () => {
const testId = "./broken.less";
const compiler = getCompiler(testId);
const stats = await compile(compiler);

expect(getWarnings(stats)).toMatchSnapshot("warnings");
expect(getErrors(stats)).toMatchSnapshot("errors");
});
});

0 comments on commit d106790

Please sign in to comment.