-
Notifications
You must be signed in to change notification settings - Fork 921
/
index.test.js
36 lines (33 loc) · 1.12 KB
/
index.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const dedent = require('dedent');
const {testFixture, testRuntimeFixture} = require('../../../fixture-utils');
const {fmtjson} = require('../../../test-utils');
const pkg = {
'index.js': dedent`
import {NetworkCanvas} from '@nivo/network';
`,
'package.json': fmtjson({
dependencies: {
'@nivo/core': '^0.72.0',
'@nivo/network': '^0.72.0',
},
}),
};
/**
* Fixes #3466
* Main thing we’re testing for here is that dev server doesn’t hang on circular deps
* Though this test is slow, it’s important to test on real npm packages and not mocked ones
* as symlink behavior is really different here
*/
describe.skip('@nivo/core', () => {
// note: skipped because test can be run locally, but not in GitHub for some reason
it('dev', async () => {
const server = await testRuntimeFixture(pkg);
const js = (await server.loadUrl('/index.js')).contents.toString('utf8');
expect(js).toBeTruthy(); // if this returned some response,
await server.cleanup(); // clean up
});
it('build', async () => {
const result = await testFixture(pkg);
expect(result['index.js']).toBeTruthy();
});
});