-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing content key in symbol prop when asset is removed (#9627)
- Loading branch information
1 parent
0b77a56
commit 2aa753c
Showing
2 changed files
with
48 additions
and
2 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
33 changes: 33 additions & 0 deletions
33
packages/core/integration-tests/test/symbol-propagation.js
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,33 @@ | ||
import assert from 'assert'; | ||
import path from 'path'; | ||
import {bundler, run, overlayFS, fsFixture} from '@parcel/test-utils'; | ||
|
||
describe('symbol propagation', () => { | ||
it('should handle removed assets from previous failed builds', async () => { | ||
await fsFixture(overlayFS, __dirname)` | ||
broken.js: | ||
module.exports = require('./missing.js'); | ||
working.js: | ||
module.exports = 'ITS WORKING'; | ||
index.js: | ||
module.exports = require('./broken.js');`; | ||
|
||
let b = bundler(path.join(__dirname, 'index.js'), { | ||
inputFS: overlayFS, | ||
shouldDisableCache: false, | ||
}); | ||
|
||
await assert.rejects(() => b.run(), { | ||
message: `Failed to resolve './missing.js' from './broken.js'`, | ||
}); | ||
|
||
await overlayFS.writeFile( | ||
path.join(__dirname, 'index.js'), | ||
`module.exports = require('./working.js');`, | ||
); | ||
|
||
let {bundleGraph} = await b.run(); | ||
|
||
assert(await run(bundleGraph), 'ITS WORKING'); | ||
}); | ||
}); |