Sha256: bea28e21937c07fbc80c9f192568059615c2f4fcfca0a4d7b3ba23b73383149e
Contents?: true
Size: 1.38 KB
Versions: 5
Compression:
Stored size: 1.38 KB
Contents
/* test expect, describe, afterAll, beforeEach */ const { resolve } = require('path') const { chdirTestApp, chdirCwd } = require('../utils/helpers') chdirTestApp() describe('Development environment', () => { afterAll(chdirCwd) describe('webpackConfig', () => { beforeEach(() => jest.resetModules()) test('should use development config and environment including devServer if WEBPACK_DEV_SERVER', () => { process.env.RAILS_ENV = 'development' process.env.NODE_ENV = 'development' process.env.WEBPACK_DEV_SERVER = 'YES' const { webpackConfig } = require('../index') expect(webpackConfig.output.path).toEqual(resolve('public', 'packs')) expect(webpackConfig.output.publicPath).toEqual('/packs/') expect(webpackConfig).toMatchObject({ devServer: { host: 'localhost', port: 3035, injectClient: true } }) }) test('should use development config and environment if WEBPACK_DEV_SERVER', () => { process.env.RAILS_ENV = 'development' process.env.NODE_ENV = 'development' process.env.WEBPACK_DEV_SERVER = undefined const { webpackConfig } = require('../index') expect(webpackConfig.output.path).toEqual(resolve('public', 'packs')) expect(webpackConfig.output.publicPath).toEqual('/packs/') expect(webpackConfig.devServer).toEqual(undefined) }) }) })
Version data entries
5 entries across 5 versions & 1 rubygems