mirror of
https://github.com/ivuorinen/config-checker.git
synced 2026-01-26 03:13:59 +00:00
21 lines
682 B
JavaScript
21 lines
682 B
JavaScript
/* eslint no-console: "off" -- CLI app that gives users feedback */
|
|
|
|
const path = require("node:path");
|
|
const configChecker = require("..");
|
|
const assert = require("node:assert").strict;
|
|
|
|
const configs = configChecker("test", path.join(__dirname, "fixtures"));
|
|
|
|
/**
|
|
* Checks if an array contains a file.
|
|
* @param {string[]} c The array of configs to check.
|
|
* @param {string} file The file to check for.
|
|
* @returns {boolean} - True if the array contains the file.
|
|
*/
|
|
const arrayContains = (c = [], file = "") => c.includes(file);
|
|
|
|
assert.ok(arrayContains(configs, ".testrc"));
|
|
assert.ok(arrayContains(configs, ".config/testrc.ts"));
|
|
|
|
console.info("configChecker tests passed");
|