Skip to content

Commit

Permalink
add id to plugin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Jun 16, 2022
1 parent 3bea172 commit f015d27
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/plugin-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,7 @@ let pluginTests = {
} catch (e) {
assert.deepStrictEqual(e.warnings, [])
assert.deepStrictEqual(e.errors, [{
id: '',
pluginName: '',
text: 'Expected ";" but found "y"',
location: {
Expand All @@ -1250,6 +1251,7 @@ let pluginTests = {
async transformUndefinedDetailForWarning({ esbuild }) {
const result = await esbuild.transform('typeof x == "null"')
assert.deepStrictEqual(result.warnings, [{
id: 'impossible-typeof',
pluginName: '',
text: 'The "typeof" operator will never evaluate to "null"',
location: {
Expand Down Expand Up @@ -1282,6 +1284,7 @@ let pluginTests = {
} catch (e) {
assert.deepStrictEqual(e.warnings, [])
assert.deepStrictEqual(e.errors, [{
id: '',
pluginName: '',
text: 'Expected ";" but found "y"',
location: {
Expand All @@ -1306,6 +1309,7 @@ let pluginTests = {
logLevel: 'silent',
})
assert.deepStrictEqual(result.warnings, [{
id: 'impossible-typeof',
pluginName: '',
text: 'The "typeof" operator will never evaluate to "null"',
location: {
Expand Down Expand Up @@ -1427,6 +1431,7 @@ let pluginTests = {
assert.strictEqual(e.warnings.length, 0)
assert.strictEqual(e.errors.length, 1)
assert.deepStrictEqual(e.errors[0], {
id: '',
pluginName: 'the-plugin',
text: 'some error',
location: {
Expand Down Expand Up @@ -1500,6 +1505,7 @@ let pluginTests = {
})
assert.strictEqual(result.warnings.length, 1)
assert.deepStrictEqual(result.warnings[0], {
id: '',
pluginName: 'other-plugin',
text: 'some warning',
location: {
Expand Down Expand Up @@ -1575,6 +1581,7 @@ let pluginTests = {
assert.strictEqual(e.warnings.length, 0)
assert.strictEqual(e.errors.length, 1)
assert.deepStrictEqual(e.errors[0], {
id: '',
pluginName: 'the-plugin',
text: 'some error',
location: {
Expand Down Expand Up @@ -1647,6 +1654,7 @@ let pluginTests = {
})
assert.strictEqual(result.warnings.length, 1)
assert.deepStrictEqual(result.warnings[0], {
id: '',
pluginName: 'the-plugin',
text: 'some warning',
location: {
Expand Down

0 comments on commit f015d27

Please sign in to comment.