-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'fixtureFromGraph' test helper function #331
Add 'fixtureFromGraph' test helper function #331
Conversation
Created using spr 1.3.5
*/ | ||
export function asset( | ||
path: string, | ||
dependencies?: (string | DependencySpec)[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use DependencySpec
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way you can do:
await fixtureFromGraph('dir', fs, [
asset('file1.js', ['file2.js', 'file3.js']),
asset('file2.js'),
asset('file3.js'),
]);
Which builds:
file1 -> file2
file1 -> file3
Instead of
await fixtureFromGraph('dir', fs, [
asset('file1.js', [
{ to: 'file2.js', type: 'sync' },
{ to: 'file3.js', type: 'sync' }
]),
asset('file2.js'),
asset('file3.js'),
]);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I just don't love the inconsistency but it's mostly a nit
Created using spr 1.3.5 [skip ci]
Created using spr 1.3.5
This is to easily set-up testing fixtures that only care about the graph relations between source files. This will be used for integration testing the bundler algorithm. Test Plan: yarn test Pull Request: #331
Created using spr 1.3.5 [skip ci]
This is to easily set-up testing fixtures that only care about the graph
relations between source files.
This will be used for integration testing the bundler algorithm.
Test Plan: yarn test