mirror of
https://github.com/PR0M3TH3AN/Archivestr.git
synced 2026-03-07 18:52:53 +00:00
update
This commit is contained in:
@@ -24,7 +24,7 @@ async function runTests(i) {
|
||||
return new Promise((resolve) => {
|
||||
// Pass strictly the test args to the child process
|
||||
const child = spawn('node', ['--test', ...testArgs], {
|
||||
stdio: ['ignore', 'pipe', 'pipe']
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
});
|
||||
|
||||
let stdout = '';
|
||||
|
||||
@@ -12,7 +12,7 @@ function getFiles(dir, files = []) {
|
||||
files.push(name);
|
||||
}
|
||||
}
|
||||
} catch (_e) {
|
||||
} catch {
|
||||
// ignore if dir doesn't exist
|
||||
}
|
||||
return files;
|
||||
@@ -45,11 +45,11 @@ for (const file of testFiles) {
|
||||
// Naive check for assertions: look for assert., expect(, t.
|
||||
// Many tests use 't' context from node:test
|
||||
if (!content.includes('assert.') && !content.includes('expect(') && !content.includes('t.plan') && !content.includes('strictEqual')) {
|
||||
// This is very naive, might false positive on 't.ok' etc.
|
||||
// Let's look for common assertion keywords.
|
||||
const assertionKeywords = ['assert', 'expect', 'strictEqual', 'deepStrictEqual', 'ok', 'equal'];
|
||||
const hasAssertion = assertionKeywords.some(k => content.includes(k));
|
||||
if (!hasAssertion) issues.push('No obvious assertions');
|
||||
// This is very naive, might false positive on 't.ok' etc.
|
||||
// Let's look for common assertion keywords.
|
||||
const assertionKeywords = ['assert', 'expect', 'strictEqual', 'deepStrictEqual', 'ok', 'equal'];
|
||||
const hasAssertion = assertionKeywords.some(k => content.includes(k));
|
||||
if (!hasAssertion) issues.push('No obvious assertions');
|
||||
}
|
||||
|
||||
if (issues.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user