Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix: fix circular dependency loop in dev
- Loading branch information
Showing
4 changed files
with
65 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'snowpack': patch | ||
--- | ||
|
||
Bugfix: dev server hanging on circular dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
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('@nivo/core', () => { | ||
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 | ||
}, 60000); // wait an extra long time | ||
|
||
it('build', async () => { | ||
const result = await testFixture(pkg); | ||
expect(result['index.js']).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters