Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 725ca69

Browse files
committed
test(webpack): fix test on windows
1 parent d596b6a commit 725ca69

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/webpack/loader-impl.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { join } from 'path';
12
import * as loader from './loader-impl';
23
import * as helpers from '../util/helpers';
34

@@ -28,7 +29,7 @@ describe('webpack loader', () => {
2829
const mockContext = getMockContext();
2930
const mockSourceMap = { };
3031
const sourceString = 'sourceString';
31-
const fakePath = '/some/path/content.js';
32+
const fakePath = join(process.cwd(), 'some', 'path', 'content.js');
3233
const fakeContent = 'SomeFileContent';
3334
const mockWebpackObject = getMockWebpackObject(fakePath);
3435
const spy = jasmine.createSpy('mock webpack callback');
@@ -61,7 +62,7 @@ describe('webpack loader', () => {
6162

6263
const mockSourceMap = { };
6364
const sourceString = 'sourceString';
64-
const fakePath = '/some/path/content.js';
65+
const fakePath = join(process.cwd(), 'some', 'path', 'content.js');
6566
const fakeContent = `{"test": "test"}`;
6667
const mockWebpackObject = getMockWebpackObject(fakePath);
6768
const spy = jasmine.createSpy('mock webpack callback');
@@ -99,7 +100,7 @@ describe('webpack loader', () => {
99100
const mockContext = getMockContext();
100101
const mockSourceMap = { };
101102
const sourceString = 'sourceString';
102-
const fakePath = '/some/path/content.js';
103+
const fakePath = join(process.cwd(), 'some', 'path', 'content.js');
103104
const mockWebpackObject = getMockWebpackObject(fakePath);
104105
const spy = jasmine.createSpy('mock webpack callback');
105106
spy.and.callFake(() => {
@@ -128,7 +129,7 @@ describe('webpack loader', () => {
128129
const mockContext = getMockContext();
129130
const mockSourceMap = { };
130131
const sourceString = 'sourceString';
131-
const fakePath = '/some/path/content.js';
132+
const fakePath = join(process.cwd(), 'some', 'path', 'content.js');
132133
const fakeContent = `{"test": "test"}`;
133134
const mockWebpackObject = getMockWebpackObject(fakePath);
134135
const callbackSpy = jasmine.createSpy('mock webpack callback');

0 commit comments

Comments
 (0)