diff --git a/test/__snapshots__/implementation-option.test.js.no-node-sass.snap b/test/__snapshots__/implementation-option.test.js.no-node-sass.snap index 04b7e2d0..68f8787b 100644 --- a/test/__snapshots__/implementation-option.test.js.no-node-sass.snap +++ b/test/__snapshots__/implementation-option.test.js.no-node-sass.snap @@ -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`] = `[]`; diff --git a/test/implementation-option.test.js b/test/implementation-option.test.js index c98f3825..ba11835c 100644 --- a/test/implementation-option.test.js +++ b/test/implementation-option.test.js @@ -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();