Browse Source

fix tests

pull/62/head
Nicolas Beaussart 6 years ago
parent
commit
53f3899635
  1. 58
      src/tests/add/__snapshots__/prettier.spec.ts.snap
  2. 9
      src/tests/add/prettier.spec.ts

58
src/tests/add/__snapshots__/prettier.spec.ts.snap

@ -195,15 +195,6 @@ exports[`nbx add:prettier should work with tslint and commits and with an empty
`;
exports[`nbx add:prettier should work with tslint and commits and with an empty config 2`] = `
"<html>
<body>
<a>testokiii</a>
</body>
</html>
"
`;
exports[`nbx add:prettier should work with tslint and commits and with an empty config 3`] = `
Array [
"Adding prettier as a dev dependency",
"The step was done without any error.",
@ -236,15 +227,6 @@ exports[`nbx add:prettier should work with tslint and commits and with an existi
`;
exports[`nbx add:prettier should work with tslint and commits and with an existing extends as array 2`] = `
"<html>
<body>
<a>testokiii</a>
</body>
</html>
"
`;
exports[`nbx add:prettier should work with tslint and commits and with an existing extends as array 3`] = `
Array [
"Adding prettier as a dev dependency",
"The step was done without any error.",
@ -277,15 +259,6 @@ exports[`nbx add:prettier should work with tslint and commits and with an existi
`;
exports[`nbx add:prettier should work with tslint and commits and with an existing extends as string 2`] = `
"<html>
<body>
<a>testokiii</a>
</body>
</html>
"
`;
exports[`nbx add:prettier should work with tslint and commits and with an existing extends as string 3`] = `
Array [
"Adding prettier as a dev dependency",
"The step was done without any error.",
@ -318,15 +291,6 @@ exports[`nbx add:prettier should work with tslint and commits and with an existi
`;
exports[`nbx add:prettier should work with tslint and commits and with an existing rules config 2`] = `
"<html>
<body>
<a>testokiii</a>
</body>
</html>
"
`;
exports[`nbx add:prettier should work with tslint and commits and with an existing rules config 3`] = `
Array [
"Adding prettier as a dev dependency",
"The step was done without any error.",
@ -349,6 +313,28 @@ Array [
]
`;
exports[`nbx add:prettier should work with tslint and commits and with only lint with l flag 1`] = `
Array [
"Adding tslint-config-prettier as a dev dependency",
"The step was done without any error.",
"Adding tslint-plugin-prettier as a dev dependency",
"The step was done without any error.",
"Updating tslint.json",
"The step was done without any error.",
]
`;
exports[`nbx add:prettier should work with tslint and commits and with only lint with onlyLint flag 1`] = `
Array [
"Adding tslint-config-prettier as a dev dependency",
"The step was done without any error.",
"Adding tslint-plugin-prettier as a dev dependency",
"The step was done without any error.",
"Updating tslint.json",
"The step was done without any error.",
]
`;
exports[`nbx add:prettier should work without commits 1`] = `
"<html>
<body>

9
src/tests/add/prettier.spec.ts

@ -10,7 +10,7 @@ import {
TestRun,
} from '../test-helpers.spec';
jest.setTimeout(90000);
jest.setTimeout(6000);
const beforeCreateHtml = async () => {
filesystem.write('test.html', '<html><body><a>testokiii</a></body></html>');
@ -62,10 +62,10 @@ export const expectEslintWithParams = ({
expectGitCommits({
before: async () => {
filesystem.write(eslintName, eslintJson);
await beforeCreateHtml();
if (onlyLint) {
prompts.inject([true, true]);
} else {
await beforeCreateHtml();
prompts.inject([true, '**/*.{js,vue,json,ts,tsx,md,yml,html}', true]);
}
},
@ -156,10 +156,10 @@ export const expectTslintWithParams = ({
expectGitCommits({
before: async () => {
filesystem.write('tslint.json', tslintJson);
await beforeCreateHtml();
if (onlyLint) {
prompts.inject([true, true]);
} else {
await beforeCreateHtml();
prompts.inject([true, '**/*.{js,vue,json,ts,tsx,md,yml,html}', true]);
}
},
@ -250,7 +250,6 @@ testCli({
'There is no package.json not found in the current folder',
before: async () => {
filesystem.remove('package.json');
prompts.inject([true, '**/*.{js,vue,json,ts,tsx,md,yml,html}']);
},
}),
},
@ -264,7 +263,7 @@ testCli({
},
},
before: async () => {
prompts.inject([true, '**/*.{js,vue,json,ts,tsx,md,yml,html}']);
prompts.inject([true]);
},
}),
},

Loading…
Cancel
Save