From 1612e20e6ddff77406f1196ec1990bab010a6433 Mon Sep 17 00:00:00 2001 From: Jeff See Date: Tue, 2 Jul 2024 16:18:45 -0700 Subject: [PATCH] Filter tests for windoes --- package.json | 2 +- prepare-install.js | 22 ---------------------- test/integration.test.js | 22 +++++++++++++++++++++- 3 files changed, 22 insertions(+), 24 deletions(-) delete mode 100644 prepare-install.js diff --git a/package.json b/package.json index 4130d9d7..80cd5403 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "prepublishOnly": "tsc && rm out/utils/*.d.ts && rm out/tsconfig.tsbuildinfo", "prettier-check": "prettier --check .", "prettier-fix": "prettier --write .", - "test": "cat package-lock.json && jest --verbose", + "test": "jest --verbose", "test-verbose": "tsc --sourceMap && jest --verbose --coverage --globals \"{\\\"coverage\\\":true}\"" }, "prettier": "@vercel/style-guide/prettier", diff --git a/prepare-install.js b/prepare-install.js deleted file mode 100644 index 70217f7a..00000000 --- a/prepare-install.js +++ /dev/null @@ -1,22 +0,0 @@ -const { unlinkSync, readFileSync, writeFileSync } = require('fs'); -const { join } = require('path'); - -const isWin = process.platform === 'win32'; - -if (isWin) { - const pkgJson = readFileSync(join(__dirname, 'package.json'), 'utf8'); - const pkg = JSON.parse(pkgJson); - - unlinkSync(join(__dirname, 'package-lock.json')); - // Delete the integration tests that will never work in Windows - unlinkSync(join(__dirname, 'test', 'integration', 'argon2.js')); - unlinkSync(join(__dirname, 'test', 'integration', 'highlights.js')); - unlinkSync(join(__dirname, 'test', 'integration', 'hot-shots.js')); - unlinkSync(join(__dirname, 'test', 'integration', 'loopback.js')); - unlinkSync(join(__dirname, 'test', 'integration', 'playwright-core.js')); - delete pkg.devDependencies['argon2']; - delete pkg.devDependencies['highlights']; - delete pkg.devDependencies['hot-shots']; - - writeFileSync(join(__dirname, 'package.json'), JSON.stringify(pkg)); -} diff --git a/test/integration.test.js b/test/integration.test.js index 8a3ae867..6a23e8dd 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -12,7 +12,27 @@ jest.setTimeout(200_000); const integrationDir = `${__dirname}${path.sep}integration`; -for (const integrationTest of readdirSync(integrationDir)) { +const integrationTests = readdirSync(integrationDir); +const filteredTestsToRun = integrationTests.filter((testName) => { + const isWin = process.platform === 'win32'; + if ( + isWin && + [ + 'argon2.js', + 'highlights.js', + 'hot-shots.js', + 'loopback.js', + 'playwright-core.js', + ].includes(testName) + ) { + return false; + } + return true; +}); + +for (const integrationTest of filteredTestsToRun) { + console.log('Integration test: ' + integrationTest); + let currentIntegrationDir = integrationDir; it(`should correctly trace and correctly execute ${integrationTest}`, async () => {