Skip to content

Commit

Permalink
better formatting for stdin plugin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Feb 1, 2021
1 parent 76eafee commit ad97902
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions scripts/plugin-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,8 @@ let pluginTests = {
const output = path.join(testDir, 'out.js')
await esbuild.build({
stdin: {
contents: `import x from "plugin"; export default x`, sourcefile: 'stdin-sourcefile',
contents: `import x from "plugin"; export default x`,
sourcefile: 'stdin-sourcefile',
},
bundle: true, outfile: output, format: 'cjs', plugins: [{
name: 'name',
Expand All @@ -773,7 +774,8 @@ let pluginTests = {
const output = path.join(testDir, 'out.js')
await esbuild.build({
stdin: {
contents: `import x from "plugin"; export default x`, sourcefile: 'stdin-sourcefile',
contents: `import x from "plugin"; export default x`,
sourcefile: 'stdin-sourcefile',
resolveDir: testDir,
},
bundle: true, outfile: output, format: 'cjs', plugins: [{
Expand All @@ -800,7 +802,8 @@ let pluginTests = {
const output = path.join(testDir, 'out.js')
await esbuild.build({
stdin: {
contents: `import x from "plugin"; export default x`, sourcefile: path.join(testDir, 'stdin-sourcefile'),
contents: `import x from "plugin"; export default x`,
sourcefile: path.join(testDir, 'stdin-sourcefile'),
resolveDir: testDir,
},
bundle: true, outfile: output, format: 'cjs', plugins: [{
Expand All @@ -826,7 +829,9 @@ let pluginTests = {
async stdinRelative({ esbuild, testDir }) {
const output = path.join(testDir, 'out.js')
await esbuild.build({
stdin: { contents: `import x from "./stdinRelative.js"; export default x` },
stdin: {
contents: `import x from "./stdinRelative.js"; export default x`,
},
bundle: true, outfile: output, format: 'cjs', plugins: [{
name: 'name',
setup(build) {
Expand All @@ -851,7 +856,8 @@ let pluginTests = {
const output = path.join(testDir, 'out', 'out.js')
await esbuild.build({
stdin: {
contents: `import x from "./stdinRelative.js"; export default x`, resolveDir: testDir,
contents: `import x from "./stdinRelative.js"; export default x`,
resolveDir: testDir,
},
bundle: true, outfile: output, format: 'cjs', plugins: [{
name: 'name',
Expand Down

0 comments on commit ad97902

Please sign in to comment.