Sha256: dbff71e74d58c33d51ab291456c61c813b6d773006beeb2b7c2cd6eeb4c138be
Contents?: true
Size: 1.35 KB
Versions: 5
Compression:
Stored size: 1.35 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 } }) }) 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