Skip to content

Commit

Permalink
add test for lint scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-stillman committed Oct 28, 2024
1 parent 55b4e55 commit 3ccd17d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/writeConfigs/scripts.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { getLintScripts } from './writeConfigs';

test('lint scripts with stylelint', () => {
expect(getLintScripts(true)).toEqual({
lint: 'npm run lint-code ; npm run lint-styles',
'lint:fix': 'npm run lint-code -- --fix ; npm run lint-styles -- --fix',
'lint-code': 'eslint .',
'lint-styles': "stylelint --ignore-path .gitignore '**/*.{css,scss,sass}'",
});
});
test('lint scripts without stylelint', () => {
expect(getLintScripts(false)).toEqual({
lint: 'npm run lint-code',
'lint:fix': 'npm run lint-code -- --fix',
'lint-code': 'eslint .',
});
});

0 comments on commit 3ccd17d

Please sign in to comment.