Skip to content

Commit

Permalink
fix: stories.test.js extract to main folder
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Sep 26, 2020
1 parent c4fdeae commit 4f6f97e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion plugins/jest-snapshots/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"args.d.ts",
"renderers.js",
"renderers.d.ts",
"README.md"
"README.md",
"stories.test.js"
],
"scripts": {
"build": "yarn cross-env NODE_ENV=production rollup -c",
Expand Down
3 changes: 1 addition & 2 deletions plugins/jest-snapshots/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ export default config({
input: [
'./src/index.ts',
'./src/cli.ts',
'./src/stories.test.ts',
'./src/renderers.ts',
'./src/args.ts',
'./src/renderers.ts',
],
});
2 changes: 1 addition & 1 deletion plugins/jest-snapshots/src/args.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ArgOptions } from '@component-controls/webpack-compile/cli';
import { renderers } from '@component-controls/jest-snapshots/renderers';
import { renderers } from './renderers';

export const jestCliArgs: ArgOptions = [
{
Expand Down
2 changes: 1 addition & 1 deletion plugins/jest-snapshots/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const run = async () => {
fs.mkdirSync(testFolder);
}
fs.copyFileSync(
path.resolve(__dirname, storiesFileName),
path.resolve(__dirname, '..', storiesFileName),
path.resolve(testFolder, storiesFileName),
);
await runJest(jestArgs, testFolder);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { act } from 'react-dom/test-utils';
import { loadStore } from '@component-controls/store';
import { getBundleName } from '@component-controls/webpack-compile';
import { cliArgs } from '@component-controls/webpack-compile/cli';
const { act } = require('react-dom/test-utils');
const { loadStore } = require('@component-controls/store');
const { getBundleName } = require('@component-controls/webpack-compile');
const { cliArgs } = require('@component-controls/webpack-compile/cli');

const { jestCliArgs } = require('@component-controls/jest-snapshots/args');
const { renderers } = require('@component-controls/jest-snapshots/renderers');

import { jestCliArgs } from '@component-controls/jest-snapshots/args';
import { renderers } from '@component-controls/jest-snapshots/renderers';
const bundle = getBundleName();
const store = loadStore(require(bundle));
const args = cliArgs(jestCliArgs);

const rendererName = args.parse().renderer as string;
const rendererName = args.parse().renderer;

const renderer = renderers[rendererName];

Expand Down

0 comments on commit 4f6f97e

Please sign in to comment.