Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Nov 1, 2021
1 parent 4ca178f commit 4be7105
Show file tree
Hide file tree
Showing 12 changed files with 1,861 additions and 5,291 deletions.
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const config: Config.InitialOptions = {
// Work around facebook/jest#2549
testEnvironment: 'jest-environment-node-single-context',
roots: ['test'],
setupFilesAfterEnv: ['jest-extended'],
setupFilesAfterEnv: ['jest-extended/all'],
};

export default config;
5 changes: 3 additions & 2 deletions js-api-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const args = yargs(process.argv.slice(2))
hidden: true,
});

const argv = args.argv;
const argv = args.parseSync();

if (argv.help) {
args.showHelp();
Expand All @@ -49,7 +49,8 @@ const tmpObject = tmp.dirSync({
unsafeCleanup: true,
});
const dir = tmpObject.name;
del.sync(dir); // TODO(nweiz): Use fs.rmSync() when we drop support for Node 12
// TODO(nweiz): Use fs.rmSync() when we drop support for Node 12
del.sync(dir, {force: true});
const sassPackagePath = p.join(dir, 'node_modules', 'sass');
fs.mkdirSync(sassPackagePath, {recursive: true});

Expand Down
25 changes: 20 additions & 5 deletions js-api-spec/value/color.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ skipForImpl('dart-sass', () => {
describe('SassColor', () => {
describe('construction', () => {
describe('type', () => {
const color = SassColor.rgb(18, 52, 86);
let color: SassColor;
beforeEach(() => {
color = SassColor.rgb(18, 52, 86);
});

it('is a value', () => {
expect(color).toBeInstanceOf(Value);
Expand Down Expand Up @@ -83,7 +86,10 @@ skipForImpl('dart-sass', () => {
});

describe('an RGB color', () => {
const color = SassColor.rgb(18, 52, 86);
let color: SassColor;
beforeEach(() => {
color = SassColor.rgb(18, 52, 86);
});

it('has RGB channels', () => {
expect(color.red).toBe(18);
Expand Down Expand Up @@ -119,7 +125,10 @@ skipForImpl('dart-sass', () => {
});

describe('an HSL color', () => {
const color = SassColor.hsl(120, 42, 42);
let color: SassColor;
beforeEach(() => {
color = SassColor.hsl(120, 42, 42);
});

it('has RGB channels', () => {
expect(color.red).toBe(62);
Expand Down Expand Up @@ -153,7 +162,10 @@ skipForImpl('dart-sass', () => {
});

describe('an HWB color', () => {
const color = SassColor.hwb(120, 42, 42);
let color: SassColor;
beforeEach(() => {
color = SassColor.hwb(120, 42, 42);
});

it('has RGB channels', () => {
expect(color.red).toBe(107);
Expand Down Expand Up @@ -189,7 +201,10 @@ skipForImpl('dart-sass', () => {
});

describe('changing color values', () => {
const color = SassColor.rgb(18, 52, 86);
let color: SassColor;
beforeEach(() => {
color = SassColor.rgb(18, 52, 86);
});

describe('changeRgb()', () => {
it('changes RGB values', () => {
Expand Down
29 changes: 22 additions & 7 deletions js-api-spec/value/number.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ skipForImpl('dart-sass', () => {
describe('Sass number', () => {
describe('unitless', () => {
describe('integer', () => {
const number = new SassNumber(123);
let number: SassNumber;
beforeEach(() => {
number = new SassNumber(123);
});

describe('construction', () => {
it('is a value', () => {
Expand Down Expand Up @@ -214,7 +217,10 @@ skipForImpl('dart-sass', () => {
});

describe('fuzzy integer', () => {
const number = new SassNumber(123.000000000001);
let number: SassNumber;
beforeEach(() => {
number = new SassNumber(123.000000000001);
});

it('has the correct value', () => {
expect(number.value).toBe(123.000000000001);
Expand Down Expand Up @@ -252,7 +258,10 @@ skipForImpl('dart-sass', () => {
});

describe('double', () => {
const number = new SassNumber(123.456);
let number: SassNumber;
beforeEach(() => {
number = new SassNumber(123.456);
});

it('has the correct value', () => {
expect(number.value).toBe(123.456);
Expand All @@ -267,7 +276,10 @@ skipForImpl('dart-sass', () => {
});

describe('single numerator unit', () => {
const number = new SassNumber(123, 'px');
let number: SassNumber;
beforeEach(() => {
number = new SassNumber(123, 'px');
});

describe('construction', () => {
it('has that unit', () => {
Expand Down Expand Up @@ -481,9 +493,12 @@ skipForImpl('dart-sass', () => {
});

describe('numerator and denominator units', () => {
const number = SassNumber.withUnits(123, {
numeratorUnits: ['px'],
denominatorUnits: ['ms'],
let number: SassNumber;
beforeEach(() => {
number = SassNumber.withUnits(123, {
numeratorUnits: ['px'],
denominatorUnits: ['ms'],
});
});

describe('construction', () => {
Expand Down
15 changes: 12 additions & 3 deletions js-api-spec/value/string.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ skipForImpl('dart-sass', () => {
});

describe('length and index handling', () => {
const string = new SassString('nb');
let string: SassString;
beforeEach(() => {
string = new SassString('nb');
});

it('rejects a zero index', () => {
expect(() =>
Expand All @@ -80,7 +83,10 @@ skipForImpl('dart-sass', () => {
});

describe('ASCII', () => {
const string = new SassString('nb');
let string: SassString;
beforeEach(() => {
string = new SassString('nb');
});

// sass/embedded-host-node#72
skipForImpl('sass-embedded', () => {
Expand Down Expand Up @@ -110,7 +116,10 @@ skipForImpl('dart-sass', () => {
});

describe('Unicode', () => {
const string = new SassString('a👭b👬c');
let string: SassString;
beforeEach(() => {
string = new SassString('a👭b👬c');
});

// sass/embedded-host-node#72
skipForImpl('sass-embedded', () => {
Expand Down
3 changes: 2 additions & 1 deletion lib-js/cli-args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ export async function parseArgs(
'When a test fails, enter into a dialog for how to handle it',
type: 'boolean',
default: false,
}).argv;
})
.parseSync();

const root = path.resolve(process.cwd(), argv['root-path']);

Expand Down
4 changes: 2 additions & 2 deletions lib-js/spec-directory/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class SpecOptions {
/** Create SpecOptions from yaml contents (as a string) */
static fromYaml(content: string): SpecOptions {
// TODO validate
return new SpecOptions((yaml.safeLoad(content) ?? {}) as OptionsData);
return new SpecOptions((yaml.load(content) ?? {}) as OptionsData);
}

/** Create new SpecOptions by merging this with other options */
Expand Down Expand Up @@ -72,6 +72,6 @@ export default class SpecOptions {

/** Convert this options object to a Yaml string */
toYaml(): string {
return yaml.safeDump(this.data).replace(/'(:[^']+)':/g, '$1:');
return yaml.dump(this.data).replace(/'(:[^']+)':/g, '$1:');
}
}
3 changes: 2 additions & 1 deletion lib-js/test-case/test-case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export default class TestCase {
const testCase = new TestCase(dir, impl, compiler, todoMode);
try {
testCase._result = await testCase.run();
} catch (error) {
} catch (caught) {
const error = caught instanceof Error ? caught : new Error(`${caught}`);
testCase._actual = {isSuccess: false, error: error.toString()};
testCase._result = {type: 'error', error};
}
Expand Down
Loading

0 comments on commit 4be7105

Please sign in to comment.