Skip to content

Commit

Permalink
Fix file paths in test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomek Wiszniewski committed Jun 5, 2015
1 parent 606be69 commit c2e4add
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import test from 'tape-catch';

import isomorphicEnsure from '../module';

const nodeModulesPath = resolve(
__dirname,
/\/.es5\//.test(__dirname) ? '../../' : '../',
'node_modules'
);

if (typeof require.ensure !== 'function') require.ensure = isomorphicEnsure({
loaders: {
raw: require('raw-loader'),
Expand Down Expand Up @@ -80,7 +86,7 @@ test('Works with raw-loader.', (is) => {

is.equal(
require('raw!babel/README.md'),
readFileSync('./node_modules/babel/README.md', {encoding: 'utf8'}),
readFileSync(nodeModulesPath + '/babel/README.md', {encoding: 'utf8'}),
'for module files'
);

Expand All @@ -103,9 +109,9 @@ test('Works with json-loader.', (is) => {

is.deepEqual(
require('json!babel/package.json'),
JSON.parse(
readFileSync('./node_modules/babel/package.json', {encoding: 'utf8'})
),
JSON.parse(readFileSync(
nodeModulesPath + '/babel/package.json', {encoding: 'utf8'}
)),
'for module files'
);

Expand Down

0 comments on commit c2e4add

Please sign in to comment.