diff options
| author | Andrei Listochkin <andrei.listochkin@ferrous-systems.com> | 2022-05-11 12:01:34 +0100 |
|---|---|---|
| committer | Andrei Listochkin <andrei.listochkin@ferrous-systems.com> | 2022-05-11 15:03:34 +0100 |
| commit | 18d2fb81a78eb7ec75a5850f5c0c3d42a9bd01ec (patch) | |
| tree | b3277483a3e551296e19dd62313ee5fdfac21f0d /editors/code/tests | |
| parent | 94fa8a6534cf93276ad7e205026402f24d41a0b2 (diff) | |
| download | rust-18d2fb81a78eb7ec75a5850f5c0c3d42a9bd01ec.tar.gz rust-18d2fb81a78eb7ec75a5850f5c0c3d42a9bd01ec.zip | |
search for test files instead of explicitly name them
Diffstat (limited to 'editors/code/tests')
| -rw-r--r-- | editors/code/tests/unit/index.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editors/code/tests/unit/index.ts b/editors/code/tests/unit/index.ts index 39ff36707f9..288bd60326c 100644 --- a/editors/code/tests/unit/index.ts +++ b/editors/code/tests/unit/index.ts @@ -1,3 +1,4 @@ +import { readdir } from 'fs/promises'; import * as path from 'path'; class Test { @@ -57,7 +58,8 @@ export class Context { export async function run(): Promise<void> { const context = new Context(); - const testFiles = ["launch_config.test.js", "runnable_env.test.js"]; + + const testFiles = (await readdir(path.resolve(__dirname))).filter(name => name.endsWith('.test.js')); for (const testFile of testFiles) { try { const testModule = require(path.resolve(__dirname, testFile)); |
