mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
test(standalone): add test coverage to assure root dir for staticDir throws
This commit is contained in:
parent
2279a7933c
commit
a5ebfc2bc8
@ -203,4 +203,21 @@ describe('dev cli flags', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Invalid staticDir must throw: root directory /', () => {
|
||||
const optionsWithInvalidStaticDir = {
|
||||
...cliOptions,
|
||||
staticDir: ['/'],
|
||||
};
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
cache.clear();
|
||||
});
|
||||
it('production mode', async () => {
|
||||
expect.assertions(1);
|
||||
await expect(buildStaticStandalone(optionsWithInvalidStaticDir)).rejects.toThrow(
|
||||
"Won't copy root directory. Check your staticDirs!"
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user