-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eslint-config-bananass): add tests for import rules and update b…
…uild script
- Loading branch information
1 parent
2aeb82e
commit 7b3ac33
Showing
2 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* @fileoverview Test for `import-helpful-warnings.js`, `import-module-systems.js`, `import-static-analysis.js`, and `import-style-guide.js`. | ||
*/ | ||
|
||
// -------------------------------------------------------------------------------- | ||
// Require | ||
// -------------------------------------------------------------------------------- | ||
|
||
const { strictEqual } = require('node:assert'); | ||
const { describe, it } = require('node:test'); | ||
|
||
const importHelpfulWarnings = require('./import-helpful-warnings'); | ||
const importModuleSystems = require('./import-module-systems'); | ||
const importStaticAnalysis = require('./import-static-analysis'); | ||
const importStyleGuide = require('./import-style-guide'); | ||
|
||
// -------------------------------------------------------------------------------- | ||
// Declaration | ||
// -------------------------------------------------------------------------------- | ||
|
||
const prefix = 'import/'; | ||
|
||
// -------------------------------------------------------------------------------- | ||
// Test | ||
// -------------------------------------------------------------------------------- | ||
|
||
describe('All key values must start with `import/`.', () => { | ||
it('import-helpful-warnings.js', () => { | ||
Object.keys(importHelpfulWarnings).forEach(key => { | ||
strictEqual(key.startsWith(prefix), true); | ||
}); | ||
}); | ||
|
||
it('import-module-systems.js', () => { | ||
Object.keys(importModuleSystems).forEach(key => { | ||
strictEqual(key.startsWith(prefix), true); | ||
}); | ||
}); | ||
|
||
it('import-static-analysis.js', () => { | ||
Object.keys(importStaticAnalysis).forEach(key => { | ||
strictEqual(key.startsWith(prefix), true); | ||
}); | ||
}); | ||
|
||
it('import-style-guide.js', () => { | ||
Object.keys(importStyleGuide).forEach(key => { | ||
strictEqual(key.startsWith(prefix), true); | ||
}); | ||
}); | ||
}); |