Skip to content

Commit

Permalink
fix: remove running tests in test:create
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed May 7, 2021
1 parent 1e416a3 commit ee01409
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/instrument/src/misc/jest-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const extractTests = async (
return cachedResults;
}
const projectFolder = findJestConfig(tests.testFiles[0]);
log('jest tests', tests.testFiles[0], [115, 245, 184]);
log('jest tests', tests.testFiles[0], [229, 232, 211]);
const testResults = await runProjectTests({
testFiles: tests.testFiles.map(
f => `.${path.sep}${path.relative(projectFolder, f)}`,
Expand Down
3 changes: 2 additions & 1 deletion plugins/cc-cli/src/cli/save-data-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const saveDataTemplate = async <P extends TemplateOptions>(
.join('.');

const filePath = path.resolve(testFolder, dataName);
log('saving data', filePath, [184, 226, 255]);

let existing: Record<string, any> | undefined = undefined;
if (fs.existsSync(filePath)) {
if (overwrite) {
Expand All @@ -37,6 +37,7 @@ export const saveDataTemplate = async <P extends TemplateOptions>(
}
const dataTemplate = await createDataTemplate(options, existing);
if (dataTemplate) {
log('saving data', filePath, [184, 226, 255]);
if (!fs.existsSync(testFolder)) {
fs.mkdirSync(testFolder);
}
Expand Down
6 changes: 5 additions & 1 deletion plugins/cc-cli/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ export const getStore = async ({
return cache.storyPath[storyPath];
}

const { doc, stories, components = {} } = await parseStories(storyPath);
const { doc, stories, components = {} } = await parseStories(
storyPath,
undefined,
{ jest: false },
);

if (!doc || !stories) {
throw new Error(`Invalid story path ${storyPath}`);
Expand Down

0 comments on commit ee01409

Please sign in to comment.