Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epidemian
GitHub Repository: epidemian/eslint-plugin-import
Path: blob/main/resolvers/webpack/test/loaders.js
829 views
1
'use strict';
2
3
const chai = require('chai');
4
const expect = chai.expect;
5
const path = require('path');
6
7
const resolve = require('../index').resolve;
8
9
10
const file = path.join(__dirname, 'files', 'dummy.js');
11
12
describe('inline loader syntax', function () {
13
it('strips bang-loaders', function () {
14
expect(resolve('css-loader!./src/main-module', file)).to.have.property('path')
15
.and.equal(path.join(__dirname, 'files', 'src', 'main-module.js'));
16
});
17
18
it('strips loader query string', function () {
19
expect(resolve('some-loader?param=value!./src/main-module', file)).to.have.property('path')
20
.and.equal(path.join(__dirname, 'files', 'src', 'main-module.js'));
21
});
22
23
it('strips resource query string', function () {
24
expect(resolve('./src/main-module?otherParam=otherValue', file))
25
.to.have.property('path')
26
.and.equal(path.join(__dirname, 'files', 'src', 'main-module.js'));
27
});
28
29
it('strips everything', function () {
30
expect(resolve('some-loader?param=value!./src/main-module?otherParam=otherValue', file))
31
.to.have.property('path')
32
.and.equal(path.join(__dirname, 'files', 'src', 'main-module.js'));
33
});
34
});
35
36