mirror of
https://github.com/hanzoai/esbuild.git
synced 2026-09-24 16:58:50 +00:00
remove unused argument from "installForTests"
This commit is contained in:
@@ -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
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,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, `
|
||||
|
||||
@@ -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
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user