mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-13 09:11:51 +00:00
search for test files instead of explicitly name them
This commit is contained in:
parent
94fa8a6534
commit
18d2fb81a7
1 changed files with 3 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { readdir } from 'fs/promises';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
class Test {
|
class Test {
|
||||||
|
|
@ -57,7 +58,8 @@ export class Context {
|
||||||
|
|
||||||
export async function run(): Promise<void> {
|
export async function run(): Promise<void> {
|
||||||
const context = new Context();
|
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) {
|
for (const testFile of testFiles) {
|
||||||
try {
|
try {
|
||||||
const testModule = require(path.resolve(__dirname, testFile));
|
const testModule = require(path.resolve(__dirname, testFile));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue