Path: blob/main/resolvers/webpack/test/loaders.js
829 views
'use strict';12const chai = require('chai');3const expect = chai.expect;4const path = require('path');56const resolve = require('../index').resolve;789const file = path.join(__dirname, 'files', 'dummy.js');1011describe('inline loader syntax', function () {12it('strips bang-loaders', function () {13expect(resolve('css-loader!./src/main-module', file)).to.have.property('path')14.and.equal(path.join(__dirname, 'files', 'src', 'main-module.js'));15});1617it('strips loader query string', function () {18expect(resolve('some-loader?param=value!./src/main-module', file)).to.have.property('path')19.and.equal(path.join(__dirname, 'files', 'src', 'main-module.js'));20});2122it('strips resource query string', function () {23expect(resolve('./src/main-module?otherParam=otherValue', file))24.to.have.property('path')25.and.equal(path.join(__dirname, 'files', 'src', 'main-module.js'));26});2728it('strips everything', function () {29expect(resolve('some-loader?param=value!./src/main-module?otherParam=otherValue', file))30.to.have.property('path')31.and.equal(path.join(__dirname, 'files', 'src', 'main-module.js'));32});33});343536