From 3ccd17d71e1b5a7692b3e04b8ffbc835e8573a6c Mon Sep 17 00:00:00 2001 From: Josh Stillman Date: Mon, 28 Oct 2024 13:46:31 -0400 Subject: [PATCH] add test for lint scripts --- src/writeConfigs/scripts.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/writeConfigs/scripts.test.ts diff --git a/src/writeConfigs/scripts.test.ts b/src/writeConfigs/scripts.test.ts new file mode 100644 index 0000000..6c2b14b --- /dev/null +++ b/src/writeConfigs/scripts.test.ts @@ -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 .', + }); +});