Skip to content
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 ava modules to test module paths #151

Merged

Conversation

floatdrop
Copy link
Contributor

Drawback - now you can require any module from ava/node_module in tests.

Closes #144

@sindresorhus
Copy link
Member

I don't think this is compatible with npm@3, though. As it could put babel-runtime on any level of the dependency tree, to flatten it.

@@ -2,6 +2,7 @@
var resolveFrom = require('resolve-from');
var createEspowerPlugin = require('babel-plugin-espower/create');
var requireFromString = require('require-from-string');
var resolve = require('path').resolve;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually prefer to import the full module.

var path = require('path');

@sindresorhus
Copy link
Member

You also need to bump require-from-string to latest version to ensure npm never uses an older version.

@floatdrop floatdrop force-pushed the add-ava-modules-to-test-module-paths branch from 1786c69 to 46e33ed Compare November 7, 2015 12:13
@floatdrop floatdrop force-pushed the add-ava-modules-to-test-module-paths branch from 46e33ed to de0955b Compare November 7, 2015 12:14
@floatdrop
Copy link
Contributor Author

Fixed.

sindresorhus added a commit that referenced this pull request Nov 7, 2015
…-paths

Add ava modules to test module paths
@sindresorhus sindresorhus merged commit 5ec1574 into avajs:master Nov 7, 2015
@sindresorhus
Copy link
Member

Awesome! Thanks for working on this and resolving it so quickly @floatdrop :)

Continues in: #152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants