Skip to content

Commit

Permalink
Update TS validator assertions (#6272)
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic authored May 13, 2021
1 parent 177f8ee commit 06183b9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/core/integration-tests/test/ts-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('ts-validator', function() {
assert.equal(entryDiagnostic.origin, '@parcel/validator-typescript');
assert.equal(
entryDiagnostic.message,
`Argument of type '"a string"' is not assignable to parameter of type 'Params'.`,
`Argument of type 'string' is not assignable to parameter of type 'Params'.`,
);
assert.equal(entryDiagnostic.filePath, entry);

Expand Down Expand Up @@ -92,7 +92,7 @@ describe('ts-validator', function() {
assert.equal(buildEvent.diagnostics.length, 1);
assert.equal(
buildEvent.diagnostics[0].message,
"Type '\"This is a type error!\"' is not assignable to type 'number'.",
"Type 'string' is not assignable to type 'number'.",
);

await outputFS.writeFile(
Expand All @@ -106,14 +106,14 @@ describe('ts-validator', function() {

await outputFS.writeFile(
path.join(inputDir, '/index.ts'),
`export const message: boolean = "Now it is back!"`,
`export const message: boolean = {}`,
);
buildEvent = await getNextBuild(b);
assert.equal(buildEvent.type, 'buildFailure');
assert.equal(buildEvent.diagnostics.length, 1);
assert.equal(
buildEvent.diagnostics[0].message,
"Type '\"Now it is back!\"' is not assignable to type 'boolean'.",
"Type '{}' is not assignable to type 'boolean'.",
);
});

Expand Down Expand Up @@ -185,9 +185,9 @@ describe('ts-validator', function() {

let buildEvent = await getNextBuild(b);
assert.equal(buildEvent.type, 'buildFailure');
assert.equal(buildEvent.diagnostics.length, 1);
assert.equal(buildEvent.diagnostics.length, 2);
assert.equal(
buildEvent.diagnostics[0].message,
buildEvent.diagnostics[1].message,
"Argument of type 'string' is not assignable to parameter of type 'number'.",
);

Expand Down

0 comments on commit 06183b9

Please sign in to comment.