Path: blob/main/resolvers/webpack/test/fallback.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', 'src', 'dummy.js');1011describe('fallback', function () {12it('works', function () {13expect(resolve('fb-module', file)).property('path')14.to.equal(path.join(__dirname, 'files', 'fallback', 'fb-module.js'));15});16it('really works', function () {17expect(resolve('jsx/some-fb-file', file)).property('path')18.to.equal(path.join(__dirname, 'files', 'fallback', 'jsx', 'some-fb-file.js'));19});20it('prefer root', function () {21expect(resolve('jsx/some-file', file)).property('path')22.to.equal(path.join(__dirname, 'files', 'src', 'jsx', 'some-file.js'));23});24it('supports definition as an array', function () {25expect(resolve('fb-module', file, { config: 'webpack.array-root.config.js' }))26.property('path')27.to.equal(path.join(__dirname, 'files', 'fallback', 'fb-module.js'));28});29});303132