mirror of
https://github.com/ivuorinen/config-checker.git
synced 2026-02-08 04:46:03 +00:00
feat: initial import from base-configs
This commit is contained in:
20
__tests__/config-checker.test.js
Normal file
20
__tests__/config-checker.test.js
Normal file
@@ -0,0 +1,20 @@
|
||||
/* 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')
|
||||
0
__tests__/fixtures/.config/testrc.ts
Normal file
0
__tests__/fixtures/.config/testrc.ts
Normal file
0
__tests__/fixtures/.testrc
Normal file
0
__tests__/fixtures/.testrc
Normal file
Reference in New Issue
Block a user