Skip to content

Commit

Permalink
Merge pull request #14196 from storybookjs/13988-standalone-tests
Browse files Browse the repository at this point in the history
Core: Fix standalone and add tests
  • Loading branch information
shilman authored Mar 10, 2021
2 parents 908d3b0 + 9d837b9 commit 1c4c2dd
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app/angular/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/ts3.9/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/aurelia/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/ember/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/html/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/marionette/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/marko/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/mithril/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/preact/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/rax/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/react/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/riot/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/server/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
34 changes: 34 additions & 0 deletions app/standalone.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import build from '@storybook/core/standalone';

jest.mock('@storybook/core/standalone');

describe.each([
['angular'],
['aurelia'],
['ember'],
['html'],
['marionette'],
['marko'],
['mithril'],
['preact'],
['rax'],
['react'],
['riot'],
['server'],
['svelte'],
['vue'],
['vue3'],
['web-components'],
])('%s', (app) => {
it('should run standalone', async () => {
// eslint-disable-next-line import/no-dynamic-require, global-require
const storybook = require(`@storybook/${app}/standalone`);

await storybook({
mode: 'static',
outputDir: '',
});

expect(build).toHaveBeenCalled();
});
});
2 changes: 1 addition & 1 deletion app/svelte/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/vue/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/vue3/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/web-components/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const build = require('@storybook/core/standalone');
const frameworkOptions = require('./dist/server/options').default;
const frameworkOptions = require('./dist/cjs/server/options').default;

async function buildStandalone(options) {
return build(options, frameworkOptions);
Expand Down

0 comments on commit 1c4c2dd

Please sign in to comment.