Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Jul 25, 2024
1 parent 901e6b4 commit 3a6bf13
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 2 deletions.
106 changes: 106 additions & 0 deletions test/__snapshots__/implementation-option.test.js.no-node-sass.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,111 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`implementation option 'dart-sass', 'legacy' API: errors 1`] = `[]`;

exports[`implementation option 'dart-sass', 'legacy' API: warnings 1`] = `[]`;

exports[`implementation option 'dart-sass', 'modern' API: errors 1`] = `[]`;

exports[`implementation option 'dart-sass', 'modern' API: warnings 1`] = `[]`;

exports[`implementation option 'dart-sass', 'modern-compiler' API: errors 1`] = `[]`;

exports[`implementation option 'dart-sass', 'modern-compiler' API: warnings 1`] = `[]`;

exports[`implementation option 'sass_string', 'legacy' API: errors 1`] = `[]`;

exports[`implementation option 'sass_string', 'legacy' API: warnings 1`] = `[]`;

exports[`implementation option 'sass-embedded', 'legacy' API: errors 1`] = `[]`;

exports[`implementation option 'sass-embedded', 'legacy' API: warnings 1`] = `[]`;

exports[`implementation option 'sass-embedded', 'modern' API: errors 1`] = `[]`;

exports[`implementation option 'sass-embedded', 'modern' API: warnings 1`] = `[]`;

exports[`implementation option 'sass-embedded', 'modern-compiler' API: errors 1`] = `[]`;

exports[`implementation option 'sass-embedded', 'modern-compiler' API: warnings 1`] = `[]`;

exports[`implementation option not specify with legacy API: errors 1`] = `[]`;

exports[`implementation option not specify with legacy API: warnings 1`] = `[]`;

exports[`implementation option not specify with modern API: errors 1`] = `[]`;

exports[`implementation option not specify with modern API: warnings 1`] = `[]`;

exports[`implementation option not specify with modern-compiler API: errors 1`] = `[]`;

exports[`implementation option not specify with modern-compiler API: warnings 1`] = `[]`;

exports[`implementation option not specify with node-sass: errors 1`] = `[]`;

exports[`implementation option not specify with node-sass: warnings 1`] = `[]`;

exports[`implementation option not specify: errors 1`] = `[]`;

exports[`implementation option not specify: warnings 1`] = `[]`;

exports[`implementation option should not swallow an error when trying to load a sass implementation: errors 1`] = `
[
"ModuleBuildError: Module build failed (from ../src/cjs.js):
Some error sass-embedded",
]
`;

exports[`implementation option should not swallow an error when trying to load a sass implementation: warnings 1`] = `[]`;

exports[`implementation option should support switching the implementation within the same process when using the modern-compiler API: errors 1`] = `[]`;

exports[`implementation option should support switching the implementation within the same process when using the modern-compiler API: errors 2`] = `[]`;

exports[`implementation option should support switching the implementation within the same process when using the modern-compiler API: warnings 1`] = `[]`;

exports[`implementation option should support switching the implementation within the same process when using the modern-compiler API: warnings 2`] = `[]`;

exports[`implementation option should throw an error on an unknown sass implementation: errors 1`] = `
[
"ModuleBuildError: Module build failed (from ../src/cjs.js):
Error: Unknown Sass implementation "strange-sass".",
]
`;

exports[`implementation option should throw an error on an unknown sass implementation: warnings 1`] = `[]`;

exports[`implementation option should throw an error when the "info" is unparseable: errors 1`] = `
[
"ModuleBuildError: Module build failed (from ../src/cjs.js):
Error: Unknown Sass implementation "asdfj".",
]
`;

exports[`implementation option should throw an error when the "info" is unparseable: warnings 1`] = `[]`;

exports[`implementation option should throw error when the "info" does not exist: errors 1`] = `
[
"ModuleBuildError: Module build failed (from ../src/cjs.js):
Error: Unknown Sass implementation.",
]
`;

exports[`implementation option should throw error when the "info" does not exist: warnings 1`] = `[]`;

exports[`implementation option should throw error when unresolved package: errors 1`] = `
[
"ModuleBuildError: Module build failed (from ../src/cjs.js):
Error: Cannot find module 'unresolved' from 'src/utils.js'",
]
`;

exports[`implementation option should throw error when unresolved package: warnings 1`] = `[]`;

exports[`implementation option should try to load using valid order: errors 1`] = `
[
"ModuleBuildError: Module build failed (from ../src/cjs.js):
Some error sass-embedded",
]
`;

exports[`implementation option should try to load using valid order: warnings 1`] = `[]`;
6 changes: 4 additions & 2 deletions test/implementation-option.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,11 @@ describe("implementation option", () => {

expect(sassEmbeddedSpy).toHaveBeenCalledTimes(0);
expect(sassEmbeddedSpyModernAPI).toHaveBeenCalledTimes(0);
expect(nodeSassSpy).toHaveBeenCalledTimes(1);
expect(nodeSassSpy).toHaveBeenCalledTimes(isNodeSassSupported() ? 1 : 0);
expect(dartSassSpy).toHaveBeenCalledTimes(0);
expect(dartSassSpyModernAPI).toHaveBeenCalledTimes(0);
expect(dartSassSpyModernAPI).toHaveBeenCalledTimes(
isNodeSassSupported() ? 0 : 1,
);

sassEmbeddedSpy.mockClear();
sassEmbeddedSpyModernAPI.mockClear();
Expand Down

0 comments on commit 3a6bf13

Please sign in to comment.