mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-11-04 05:35:55 +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';
 | 
			
		||||
 | 
			
		||||
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));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue