Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions test/__snapshots__/sassOptions-option.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ exports[`sassOptions option should work when the option like "Object" (node-sass

exports[`sassOptions option should work when the option like "Object" (node-sass) (scss): warnings 1`] = `Array []`;

exports[`sassOptions option should work with the "fibers" option (dart-sass) (sass): css 1`] = `
exports[`sassOptions option should work with the "fiber" option (dart-sass) (sass): css 1`] = `
"@charset \\"UTF-8\\";
body {
font: 100% Helvetica, sans-serif;
Expand Down Expand Up @@ -807,11 +807,11 @@ nav a {
}"
`;

exports[`sassOptions option should work with the "fibers" option (dart-sass) (sass): errors 1`] = `Array []`;
exports[`sassOptions option should work with the "fiber" option (dart-sass) (sass): errors 1`] = `Array []`;

exports[`sassOptions option should work with the "fibers" option (dart-sass) (sass): warnings 1`] = `Array []`;
exports[`sassOptions option should work with the "fiber" option (dart-sass) (sass): warnings 1`] = `Array []`;

exports[`sassOptions option should work with the "fibers" option (dart-sass) (scss): css 1`] = `
exports[`sassOptions option should work with the "fiber" option (dart-sass) (scss): css 1`] = `
"@charset \\"UTF-8\\";
body {
font: 100% Helvetica, sans-serif;
Expand Down Expand Up @@ -848,11 +848,11 @@ nav a {
}"
`;

exports[`sassOptions option should work with the "fibers" option (dart-sass) (scss): errors 1`] = `Array []`;
exports[`sassOptions option should work with the "fiber" option (dart-sass) (scss): errors 1`] = `Array []`;

exports[`sassOptions option should work with the "fibers" option (dart-sass) (scss): warnings 1`] = `Array []`;
exports[`sassOptions option should work with the "fiber" option (dart-sass) (scss): warnings 1`] = `Array []`;

exports[`sassOptions option should work with the "fibers" option (node-sass) (sass): css 1`] = `
exports[`sassOptions option should work with the "fiber" option (node-sass) (sass): css 1`] = `
"@charset \\"UTF-8\\";
body {
font: 100% Helvetica, sans-serif;
Expand Down Expand Up @@ -899,11 +899,11 @@ nav a {
"
`;

exports[`sassOptions option should work with the "fibers" option (node-sass) (sass): errors 1`] = `Array []`;
exports[`sassOptions option should work with the "fiber" option (node-sass) (sass): errors 1`] = `Array []`;

exports[`sassOptions option should work with the "fibers" option (node-sass) (sass): warnings 1`] = `Array []`;
exports[`sassOptions option should work with the "fiber" option (node-sass) (sass): warnings 1`] = `Array []`;

exports[`sassOptions option should work with the "fibers" option (node-sass) (scss): css 1`] = `
exports[`sassOptions option should work with the "fiber" option (node-sass) (scss): css 1`] = `
"@charset \\"UTF-8\\";
body {
font: 100% Helvetica, sans-serif;
Expand Down Expand Up @@ -936,9 +936,9 @@ nav a {
"
`;

exports[`sassOptions option should work with the "fibers" option (node-sass) (scss): errors 1`] = `Array []`;
exports[`sassOptions option should work with the "fiber" option (node-sass) (scss): errors 1`] = `Array []`;

exports[`sassOptions option should work with the "fibers" option (node-sass) (scss): warnings 1`] = `Array []`;
exports[`sassOptions option should work with the "fiber" option (node-sass) (scss): warnings 1`] = `Array []`;

exports[`sassOptions option should work with the "functions" option (dart-sass) (sass): css 1`] = `
"h2, h3, h4, h5 {
Expand Down
10 changes: 8 additions & 2 deletions test/sassOptions-option.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import path from 'path';
import semver from 'semver';
import nodeSass from 'node-sass';
import dartSass from 'sass';
import Fiber from 'fibers';

import {
compile,
Expand All @@ -18,6 +19,11 @@ const implementations = [nodeSass, dartSass];
const syntaxStyles = ['scss', 'sass'];

describe('sassOptions option', () => {
beforeEach(() => {
// The `sass` (`Dart Sass`) package modify the `Function` prototype, but the `jest` lose a prototype
Object.setPrototypeOf(Fiber, Function.prototype);
});

implementations.forEach((implementation) => {
const [implementationName] = implementation.info.split('\t');

Expand Down Expand Up @@ -154,7 +160,7 @@ describe('sassOptions option', () => {
expect(stats.compilation.errors).toMatchSnapshot('errors');
});

it(`should work with the "fibers" option (${implementationName}) (${syntax})`, async () => {
it(`should work with the "fiber" option (${implementationName}) (${syntax})`, async () => {
const testId = getTestId('language', syntax);
const options = {
implementation: getImplementationByName(implementationName),
Expand All @@ -163,7 +169,7 @@ describe('sassOptions option', () => {

if (semver.satisfies(process.version, '>= 10')) {
// eslint-disable-next-line global-require
options.sassOptions.fibers = require('fibers');
options.sassOptions.fiber = Fiber;
}

const stats = await compile(testId, { loader: { options } });
Expand Down