-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleans up lint errors fixes starter kyt tests fixes core rc version in starters
- Loading branch information
Showing
37 changed files
with
744 additions
and
552 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
coverage | ||
**/node_modules | ||
packages/starter-kyts | ||
e2e_tests/fixtures | ||
|
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,5 @@ | ||
{ | ||
"scripts": { | ||
"lint-script": "kyt lint-script" | ||
} | ||
} |
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,4 @@ | ||
|
||
const test = 1; | ||
|
||
module.exports = test; |
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,5 @@ | ||
{ | ||
"scripts": { | ||
"lint-script": "kyt lint-script" | ||
} | ||
} |
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,4 @@ | ||
|
||
const test = 1 | ||
|
||
module.exports = test; |
6 changes: 6 additions & 0 deletions
6
e2e_tests/fixtures/lintScript-user-rc-with-ext/.eslintrc.json
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,6 @@ | ||
{ | ||
"extends": "eslint-config-kyt", | ||
|
||
"rules": { | ||
} | ||
} |
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,5 @@ | ||
{ | ||
"scripts": { | ||
"lint-script": "kyt lint-script" | ||
} | ||
} |
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,4 @@ | ||
|
||
const test = 1; | ||
|
||
module.exports = test; |
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,6 @@ | ||
{ | ||
"extends": "eslint-config-kyt", | ||
|
||
"rules": { | ||
} | ||
} |
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,5 @@ | ||
{ | ||
"scripts": { | ||
"lint-script": "kyt lint-script" | ||
} | ||
} |
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,4 @@ | ||
|
||
const test = 1; | ||
|
||
module.exports = test; |
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,5 @@ | ||
{ | ||
"scripts": { | ||
"lint-style": "kyt lint-style" | ||
} | ||
} |
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,3 @@ | ||
.test { | ||
color: green; | ||
} |
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,5 @@ | ||
{ | ||
"scripts": { | ||
"lint-style": "kyt lint-style" | ||
} | ||
} |
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,3 @@ | ||
#test { | ||
color: green; | ||
} |
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,5 @@ | ||
{ | ||
"scripts": { | ||
"lint-style": "kyt lint-style" | ||
} | ||
} |
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,3 @@ | ||
.test { | ||
color: green; | ||
} |
6 changes: 6 additions & 0 deletions
6
e2e_tests/fixtures/lintStyle-user-rc-with-ext/.stylelintrc.json
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,6 @@ | ||
{ | ||
"extends": "stylelint-config-kyt", | ||
|
||
"rules": { | ||
} | ||
} |
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,5 @@ | ||
{ | ||
"scripts": { | ||
"lint-style": "kyt lint-style" | ||
} | ||
} |
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,3 @@ | ||
.test { | ||
color: green; | ||
} |
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,6 @@ | ||
{ | ||
"extends": "stylelint-config-kyt", | ||
|
||
"rules": { | ||
} | ||
} |
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,5 @@ | ||
{ | ||
"scripts": { | ||
"lint-style": "kyt lint-style" | ||
} | ||
} |
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,3 @@ | ||
.test { | ||
color: green; | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"testPathDirs": [ | ||
"<rootDir>/e2e_tests" | ||
"<rootDir>/e2e_tests/tests" | ||
] | ||
} |
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,60 @@ | ||
const path = require('path'); | ||
const shell = require('shelljs'); | ||
|
||
shell.config.silent = true; | ||
|
||
const stageName = 'stage-script'; | ||
const getUsingLine = outputArr => outputArr.find(line => line.indexOf('Using ESLint file') > -1); | ||
|
||
describe('kyt lint-script', () => { | ||
beforeEach(() => { | ||
shell.mkdir(stageName); | ||
shell.cd(stageName); | ||
shell.ln('-s', | ||
path.join(process.cwd(), '../packages/kyt-core/node_modules'), | ||
path.join(process.cwd(), 'node_modules')); | ||
}); | ||
|
||
it('should exit the process with code 0 on lint success', () => { | ||
shell.cp('-R', '../e2e_tests/fixtures/lintScript-default/.', '.'); | ||
const output = shell.exec('npm run lint-script'); | ||
expect(output.code).toBe(0); | ||
}); | ||
|
||
it('should exit the process with code 1 on lint failure', () => { | ||
shell.cp('-R', '../e2e_tests/fixtures/lintScript-fail/.', '.'); | ||
const output = shell.exec('npm run lint-script'); | ||
expect(output.code).toBe(1); | ||
}); | ||
|
||
it('should bedazzle user on lint success', () => { | ||
shell.cp('-R', '../e2e_tests/fixtures/lintScript-default/.', '.'); | ||
const output = shell.exec('npm run lint-script'); | ||
const outputArr = output.stdout.split('\n'); | ||
expect(output.code).toBe(0); | ||
expect(outputArr.includes('✅ Your JS looks great ✨')).toBe(true); | ||
}); | ||
|
||
it('should support a user .eslintrc with extension', () => { | ||
shell.cp('-R', '../e2e_tests/fixtures/lintScript-user-rc-with-ext/.', '.'); | ||
const output = shell.exec('npm run lint-script'); | ||
const outputArr = output.stdout.split('\n'); | ||
const usingLine = getUsingLine(outputArr); | ||
expect(output.code).toBe(0); | ||
expect(usingLine.endsWith(`${stageName}/.eslintrc.json`)).toBe(true); | ||
}); | ||
|
||
it('should support a user .eslintrc', () => { | ||
shell.cp('-R', '../e2e_tests/fixtures/lintScript-user-rc/.', '.'); | ||
const output = shell.exec('npm run lint-script'); | ||
const outputArr = output.stdout.split('\n'); | ||
const usingLine = getUsingLine(outputArr); | ||
expect(output.code).toBe(0); | ||
expect(usingLine.endsWith(`${stageName}/.eslintrc`)).toBe(true); | ||
}); | ||
|
||
afterEach(() => { | ||
shell.cd('..'); | ||
shell.rm('-rf', stageName); | ||
}); | ||
}); |
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,66 @@ | ||
const path = require('path'); | ||
const shell = require('shelljs'); | ||
|
||
shell.config.silent = true; | ||
|
||
const stageName = 'stage-style'; | ||
const getUsingLine = outputArr => outputArr.find(line => line.indexOf('Using Stylelint file') > -1); | ||
|
||
describe('kyt lint-style', () => { | ||
beforeEach(() => { | ||
shell.mkdir(stageName); | ||
shell.cd(stageName); | ||
shell.ln('-s', | ||
path.join(process.cwd(), '../packages/kyt-core/node_modules'), | ||
path.join(process.cwd(), 'node_modules')); | ||
}); | ||
|
||
it('should exit the process with code 0 on lint success', () => { | ||
shell.cp('-R', '../e2e_tests/fixtures/lintStyle-default/.', '.'); | ||
const output = shell.exec('npm run lint-style'); | ||
expect(output.code).toBe(0); | ||
}); | ||
|
||
it('should exit the process with code 1 on lint failure', () => { | ||
shell.cp('-R', '../e2e_tests/fixtures/lintStyle-fail/.', '.'); | ||
const output = shell.exec('npm run lint-style'); | ||
expect(output.code).toBe(1); | ||
}); | ||
|
||
it('should bedazzle user on lint success', () => { | ||
shell.cp('-R', '../e2e_tests/fixtures/lintStyle-default/.', '.'); | ||
const output = shell.exec('npm run lint-style'); | ||
const outputArr = output.stdout.split('\n'); | ||
expect(output.code).toBe(0); | ||
expect(outputArr.includes('✅ Your styles look good! ✨')).toBe(true); | ||
}); | ||
|
||
it('should support a user .stylelintrc with extension', () => { | ||
shell.cp('-R', '../e2e_tests/fixtures/lintStyle-user-rc-with-ext/.', '.'); | ||
const output = shell.exec('npm run lint-style'); | ||
const outputArr = output.stdout.split('\n'); | ||
const usingLine = getUsingLine(outputArr); | ||
expect(output.code).toBe(0); | ||
expect(usingLine.endsWith(`${stageName}/.stylelintrc.json`)).toBe(true); | ||
}); | ||
|
||
it('should support a user .stylelintrc', () => { | ||
shell.cp('-R', '../e2e_tests/fixtures/lintStyle-user-rc/.', '.'); | ||
const output = shell.exec('npm run lint-style'); | ||
const outputArr = output.stdout.split('\n'); | ||
const usingLine = getUsingLine(outputArr); | ||
expect(output.code).toBe(0); | ||
expect(usingLine.endsWith(`${stageName}/.stylelintrc`)).toBe(true); | ||
}); | ||
|
||
it('should support .scss', () => { | ||
shell.cp('-R', '../e2e_tests/fixtures/lintStyle-scss/.', '.'); | ||
const output = shell.exec('npm run lint-style'); | ||
expect(output.code).toBe(0); | ||
}); | ||
|
||
afterEach(() => { | ||
shell.cd('..'); | ||
shell.rm('-rf', stageName); | ||
}); | ||
}); |
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
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
Oops, something went wrong.