generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace karma with web test runner (#316)
* poc: web test runner * add ci test * webkit is hanging * naming * shutoff webkit * unbump playwright * remove manual timeouts * use concurrency 1 * wrap up poc * run CI for poc back to back with previous impl * tie up loose ends * let wtr run to compare * add back webkit. apples to apples with karma. * remove karma * remove karma * fix tbdocs (i assume) * update ci config * better naming of scripts * fix node * revert test config changes * fix env var override * cleanup ci config * cleanup explicit deps * add back playwright
- Loading branch information
1 parent
a23b49a
commit ae975ea
Showing
53 changed files
with
3,142 additions
and
2,060 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const esbuild = require('esbuild'); | ||
const browserConfig = require('./esbuild-browser-config.cjs'); | ||
|
||
esbuild.build({ | ||
...browserConfig, | ||
format : 'esm', | ||
entryPoints : ['./tests/*.spec.*'], | ||
bundle : true, | ||
minify : false, | ||
outdir : 'tests/compiled', | ||
define : { | ||
...browserConfig.define, | ||
'process.env.TEST_DWN_URL': JSON.stringify(process.env.TEST_DWN_URL ?? null), | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const DEFAULT_TEST_DWN_URL = 'http://localhost:3000'; | ||
|
||
const getTestDwnUrl = () => process.env.TEST_DWN_URL || DEFAULT_TEST_DWN_URL; | ||
|
||
export const testDwnUrl = getTestDwnUrl(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const playwrightLauncher = | ||
require('@web/test-runner-playwright').playwrightLauncher; | ||
|
||
/** | ||
* @type {import('@web/test-runner').TestRunnerConfig} | ||
*/ | ||
module.exports = { | ||
files : 'tests/compiled/**/*.spec.js', | ||
playwright : true, | ||
nodeResolve : true, | ||
browsers : [ | ||
playwrightLauncher({ | ||
product: 'chromium', | ||
}), | ||
playwrightLauncher({ | ||
product: 'firefox', | ||
}), | ||
playwrightLauncher({ | ||
product: 'webkit', | ||
}), | ||
], | ||
testsFinishTimeout : 300000, | ||
concurrentBrowsers : 2, | ||
testFramework : { | ||
config: { | ||
timeout: '15000', | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"enable-source-maps": true, | ||
"exit": true, | ||
"spec": ["tests/compiled/**/*.spec.js"] | ||
"spec": ["tests/compiled/**/*.spec.js"], | ||
"timeout": 5000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const esbuild = require('esbuild'); | ||
const browserConfig = require('./esbuild-browser-config.cjs'); | ||
|
||
esbuild.build({ | ||
...browserConfig, | ||
format : 'esm', | ||
entryPoints : ['./tests/*.spec.*'], | ||
bundle : true, | ||
minify : false, | ||
outdir : 'tests/compiled', | ||
define : { | ||
...browserConfig.define, | ||
'process.env.TEST_DWN_URL': JSON.stringify(process.env.TEST_DWN_URL ?? null), | ||
}, | ||
}); |
Oops, something went wrong.