diff --git a/.github/workflows/build-test-and-deploy.yml b/.github/workflows/build-test-and-deploy.yml index c67b374ce..dbbb38945 100644 --- a/.github/workflows/build-test-and-deploy.yml +++ b/.github/workflows/build-test-and-deploy.yml @@ -46,7 +46,7 @@ jobs: strategy: fail-fast: false matrix: - runs-on: ['ubuntu-latest'] + runs-on: ['ubuntu-latest', 'windows-latest', 'macos-latest'] node-version: [ '18.18.0', # minimum supported 'lts/-1', # pre-latest lts diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml index 88f460dc1..0cf55d1a2 100644 --- a/.github/workflows/nightly-tests.yml +++ b/.github/workflows/nightly-tests.yml @@ -18,7 +18,7 @@ jobs: max-parallel: 1 # reduces the flakiness of these tests fail-fast: false matrix: - runs-on: ['ubuntu-latest'] + runs-on: ['ubuntu-latest', 'windows-latest', 'macos-latest'] node-version: [ # https://github.com/nodejs/release#release-schedule '18.18.0', # minimum supported 'lts/-1', # pre-latest lts diff --git a/jest.config.js b/jest.config.js index 51066a12f..219dcb313 100644 --- a/jest.config.js +++ b/jest.config.js @@ -14,6 +14,50 @@ if (process.env.NIGHTLY_TESTS_NO_LOCKFILE) { testPathIgnorePatterns.push('__tests__/babel-lib-defs-test.js'); } +if (process.platform === 'win32') { + // TODO: fix on windows + testPathIgnorePatterns.push( + ...[ + // path mismatches + 'packages/metro/src/__tests__/HmrServer-test.js', + 'packages/metro/src/DeltaBundler/__tests__/buildSubgraph-test.js', + 'packages/metro/src/DeltaBundler/__tests__/Graph-test.js', + 'packages/metro/src/DeltaBundler/Serializers/helpers/__tests__/js-test.js', + 'packages/metro/src/node-haste/lib/__tests__/AssetPaths-test.js', + 'packages/metro/src/Server/__tests__/Server-test.js', + 'packages/metro-config/src/__tests__/loadConfig-test.js', + 'packages/metro-symbolicate/src/__tests__/symbolicate-test.js', + 'packages/metro-file-map/src/__tests__/index-test.js', + 'packages/metro-file-map/src/watchers/__tests__/WatchmanWatcher-test.js', + 'packages/metro-file-map/src/crawlers/__tests__/node-test.js', + 'packages/metro-file-map/src/watchers/__tests__/integration-test.js', + + // resolveModulePath failed + 'packages/metro-cache/src/stores/__tests__/FileStore-test.js', + 'packages/metro-resolver/src/__tests__/assets-test.js', + 'packages/metro-resolver/src/__tests__/platform-extensions-test.js', + 'packages/metro-resolver/src/__tests__/symlinks-test.js', + + // const {_cwd} = this; resolution issue in `metro-memory-fs/src/index.js:1294:15` + 'packages/metro/src/__tests__/Assets-test.js', + 'packages/metro/src/DeltaBundler/__tests__/resolver-test.js', + 'packages/buck-worker-tool/src/__tests__/worker-test.js', + 'packages/metro-transform-worker/src/__tests__/index-test.js', + 'packages/metro-cache/src/stores/__tests__/AutoCleanFileStore-test.js', + 'packages/metro-cache/src/stores/__tests__/FileStore-test.js', + + // endless loading + 'packages/metro-resolver/src/__tests__/browser-spec-test.js', + 'packages/metro-resolver/src/__tests__/package-exports-test.js', + 'packages/metro-resolver/src/__tests__/index-test.js', + + // unclear issue + 'packages/metro/src/DeltaBundler/__tests__/DeltaCalculator-test.js', + 'packages/metro-file-map/src/crawlers/__tests__/integration-test.js', + ], + ); +} + /** @type {import('jest').Config} **/ module.exports = { modulePathIgnorePatterns: ['/node_modules/', 'packages/[^/]+/build/'], diff --git a/packages/metro/src/integration_tests/__tests__/server-test.js b/packages/metro/src/integration_tests/__tests__/server-test.js index dc011e948..61a2648d2 100644 --- a/packages/metro/src/integration_tests/__tests__/server-test.js +++ b/packages/metro/src/integration_tests/__tests__/server-test.js @@ -32,11 +32,11 @@ describe('Metro development server serves bundles via HTTP', () => { const bundlesDownloaded = new Set(); let serverClosedPromise; - async function downloadAndExec(path: string, context = {}): mixed { + async function downloadAndExec(pathname: string, context = {}): mixed { const response = await fetchAndClose( - 'http://localhost:' + config.server.port + path, + 'http://localhost:' + config.server.port + pathname, ); - bundlesDownloaded.add(path); + bundlesDownloaded.add(pathname.replaceAll('\\', '/')); const body = await response.text(); diff --git a/packages/metro/src/integration_tests/__tests__/server-torn-down-test.js b/packages/metro/src/integration_tests/__tests__/server-torn-down-test.js index 85c93f6fe..cdb68ad1a 100644 --- a/packages/metro/src/integration_tests/__tests__/server-torn-down-test.js +++ b/packages/metro/src/integration_tests/__tests__/server-torn-down-test.js @@ -15,6 +15,8 @@ jest.unmock('cosmiconfig'); jest.useRealTimers(); +jest.setTimeout(10000); + describe('Server torn down test', () => { const active = new Map(); const hook = asyncHooks.createHook({