remove unused argument from "installForTests"

This commit is contained in:
Evan Wallace
2020-12-18 04:11:12 -08:00
parent c88adf13a5
commit d63f986535
8 changed files with 28 additions and 22 deletions
+2 -8
View File
@@ -346,12 +346,8 @@ function concurrentMap(items, batch, callback) {
}
async function main() {
let rimraf = require('rimraf')
let path = require('path')
let installDir = path.join(__dirname, '.destructuring-fuzzer')
let es = require('./esbuild').installForTests(installDir)
let esbuild = async (x) => (await es.transform(x, { target: 'es6', loader: 'ts' })).js.trim()
let es = require('./esbuild').installForTests()
let esbuild = async (x) => (await es.transform(x, { target: 'es6', loader: 'ts' })).code.trim()
console.log(`
Options:
@@ -401,8 +397,6 @@ Legend:
await verify(test, transform, testCases)
}
}
rimraf.sync(installDir, { disableGlob: true })
}
main().catch(e => setTimeout(() => { throw e }))
+1 -5
View File
@@ -112,11 +112,7 @@ exports.buildBinary = () => {
return path.join(repoDir, process.platform === 'win32' ? 'esbuild.exe' : 'esbuild')
}
exports.installForTests = dir => {
// Create a fresh test directory
rimraf.sync(dir, { disableGlob: true })
fs.mkdirSync(dir)
exports.installForTests = () => {
// Build the "esbuild" binary and library
const esbuildPath = exports.buildBinary()
buildNativeLib(esbuildPath)
+5 -1
View File
@@ -2249,7 +2249,11 @@ async function assertSourceMap(jsSourceMap, source) {
}
async function main() {
const esbuild = installForTests(rootTestDir)
const esbuild = installForTests()
// Create a fresh test directory
rimraf.sync(rootTestDir, { disableGlob: true })
fs.mkdirSync(rootTestDir)
// Time out these tests after 5 minutes. This exists to help debug test hangs in CI.
let minutes = 5
+5 -1
View File
@@ -915,7 +915,11 @@ let pluginTests = {
}
async function main() {
const esbuild = installForTests(rootTestDir)
const esbuild = installForTests()
// Create a fresh test directory
rimraf.sync(rootTestDir, { disableGlob: true })
fs.mkdirSync(rootTestDir)
// Time out these tests after 5 minutes. This exists to help debug test hangs in CI.
let minutes = 5
+4 -1
View File
@@ -4,9 +4,12 @@ const path = require('path')
const fs = require('fs')
const rimraf = require('rimraf')
const assert = require('assert')
const esbuild = installForTests()
// Create a fresh test directory
const rootTestDir = path.join(__dirname, '.register-test')
const esbuild = installForTests(rootTestDir)
rimraf.sync(rootTestDir, { disableGlob: true })
fs.mkdirSync(rootTestDir)
const entry = path.join(rootTestDir, 'entry.ts')
fs.writeFileSync(entry, `
+5 -1
View File
@@ -21,8 +21,12 @@ async function main() {
childProcess.execSync('make demo/terser', { cwd: repoDir, stdio: 'pipe' });
U = require(terserDir);
// Create a fresh test directory
childProcess.execSync(`rm -fr "${testDir}"`);
fs.mkdirSync(testDir)
// Start the esbuild service
const esbuild = installForTests(testDir);
const esbuild = installForTests();
const service = await esbuild.startService();
// Find test files
+1 -4
View File
@@ -1,6 +1,5 @@
const fs = require('fs');
const path = require('path');
const rimraf = require('rimraf');
const jsYaml = require('js-yaml');
const { installForTests } = require('./esbuild');
const test262Dir = path.join(__dirname, '..', 'demo', 'test262', 'test');
@@ -38,8 +37,7 @@ function formatErrors(content, error) {
}
async function main() {
const testDir = path.join(__dirname, '.test262');
const { startService } = installForTests(testDir);
const { startService } = installForTests();
const service = await startService();
const files = findFiles();
let runCount = 0;
@@ -145,7 +143,6 @@ async function main() {
console.log(`minify failures: ${minifyCount}`);
// Clean up after all tests finish
rimraf.sync(testDir, { disableGlob: true });
service.stop();
}
+5 -1
View File
@@ -20,8 +20,12 @@ async function main() {
childProcess.execSync('make demo/uglify', { cwd: repoDir, stdio: 'pipe' });
U = require(path.join(uglifyDir, 'test', 'node'));
// Create a fresh test directory
childProcess.execSync(`rm -fr "${testDir}"`);
fs.mkdirSync(testDir)
// Start the esbuild service
const esbuild = installForTests(testDir);
const esbuild = installForTests();
const service = await esbuild.startService();
// Find test files