Skip to content

Commit a68fde7

Browse files
authored
Merge pull request #2 from Smittyvb/fix-emitcss-test
Fix emitCss test
2 parents 066e6f3 + 9de14d8 commit a68fde7

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

test/loader.spec.js

+18-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,16 @@ describe('loader', () => {
3232

3333
const callbackSpy = spy(cb);
3434

35+
const nameParts = fileName.split(/[/\\]/g);
36+
3537
loader.call(
3638
{
3739
cacheable: cacheableSpy,
3840
async: () => callbackSpy,
39-
resourcePath: fileName,
4041
version,
41-
query
42+
query,
43+
resourcePath: fileName,
44+
resource: nameParts[nameParts.length - 1],
4245
},
4346
fileContents,
4447
null
@@ -210,6 +213,19 @@ describe('loader', () => {
210213
);
211214
});
212215

216+
it(
217+
'should configure emitCss=true',
218+
testLoader(
219+
'test/fixtures/css.html',
220+
function(err, code, map) {
221+
expect(err).not.to.exist;
222+
223+
expect(code).to.match(/!=!svelte-loader\?cssPath=/);
224+
},
225+
{ emitCss: true }
226+
)
227+
);
228+
213229
describe('preprocess', () => {
214230
it('should preprocess successfully', done => {
215231
testLoader(

0 commit comments

Comments
 (0)