Skip to content

Commit

Permalink
Updates file unit tests to be Windows compatible (elastic#24281)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
  • Loading branch information
tylersmalley authored Oct 19, 2018
1 parent bd3f840 commit 938d130
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/dev/__tests__/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { resolve } from 'path';
import { resolve, sep } from 'path';

import expect from 'expect.js';

Expand All @@ -38,7 +38,7 @@ describe('dev/File', () => {
describe('#getRelativePath()', () => {
it('returns the path relative to the repo root', () => {
const file = new File(HERE);
expect(file.getRelativePath()).to.eql('src/dev/__tests__/file.js');
expect(file.getRelativePath()).to.eql(['src', 'dev', '__tests__', 'file.js'].join(sep));
});
});

Expand Down Expand Up @@ -69,8 +69,8 @@ describe('dev/File', () => {
it('returns the parents of a file, stopping at the repo root, in descending order', () => {
const file = new File(HERE);
expect(file.getRelativeParentDirs()).to.eql([
'src/dev/__tests__',
'src/dev',
['src', 'dev', '__tests__'].join(sep), // src/dev/__tests__
['src', 'dev'].join(sep), // src/dev
'src',
]);
});
Expand Down
6 changes: 3 additions & 3 deletions src/dev/npm/__tests__/installed_packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { resolve } from 'path';
import { resolve, sep } from 'path';

import { uniq } from 'lodash';
import expect from 'expect.js';
Expand Down Expand Up @@ -61,15 +61,15 @@ describe('src/dev/npm/installed_packages', () => {
licenses: [ 'Apache-2.0' ],
repository: 'https://github.com/mycorp/dep1',
directory: resolve(FIXTURE1_ROOT, 'node_modules/dep1'),
relative: 'node_modules/dep1',
relative: ['node_modules', 'dep1'].join(sep),
},
{
name: 'privatedep',
version: '0.0.2',
repository: 'https://github.com/mycorp/privatedep',
licenses: [ 'Apache-2.0' ],
directory: resolve(FIXTURE1_ROOT, 'node_modules/privatedep'),
relative: 'node_modules/privatedep'
relative: ['node_modules', 'privatedep'].join(sep)
}
]);
});
Expand Down

0 comments on commit 938d130

Please sign in to comment.