27 lines
795 B
JavaScript
27 lines
795 B
JavaScript
import { test } from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { run, fixtures } from "./helpers.mjs";
|
|
import { join } from "node:path";
|
|
|
|
const env = { COURSE_ROOT: join(fixtures, "course") };
|
|
const audit = (ws) => run("coupling-audit.mjs", [join(fixtures, ws)], env);
|
|
|
|
test("audit_flags_card_name_in_engine", () => {
|
|
const r = audit("ws-coupled");
|
|
assert.equal(r.code, 1);
|
|
assert.match(r.out, /core\.rs:2/);
|
|
assert.match(r.out, /core\.rs:3/);
|
|
assert.match(r.out, /Baron Rivendare/);
|
|
assert.doesNotMatch(r.out, /cards\.rs/);
|
|
});
|
|
|
|
test("audit_ignores_content_dir", () => {
|
|
const r = audit("ws-content-only");
|
|
assert.equal(r.code, 0, r.out);
|
|
});
|
|
|
|
test("audit_ignores_grammar_words", () => {
|
|
const r = audit("ws-grammar");
|
|
assert.equal(r.code, 0, r.out);
|
|
});
|