Sha256: 50b3c3d530e5d48e868bd74428695734a6622174345f0f01d11af43f366172e0
Contents?: true
Size: 1.45 KB
Versions: 14
Compression:
Stored size: 1.45 KB
Contents
/* test expect, describe, afterAll, beforeEach */ const { resolve } = require('path') const { chdirTestApp, chdirCwd } = require('../utils/helpers') const rootPath = process.cwd() chdirTestApp() describe('Production environment', () => { afterAll(() => process.chdir(rootPath)) describe('generateWebpackConfig', () => { beforeEach(() => jest.resetModules()) test('should use production config and environment', () => { process.env.RAILS_ENV = 'production' process.env.NODE_ENV = 'production' const { generateWebpackConfig } = require('../index') const webpackConfig = generateWebpackConfig() expect(webpackConfig.output.path).toEqual(resolve('public', 'packs')) expect(webpackConfig.output.publicPath).toEqual('/packs/') expect(webpackConfig).toMatchObject({ devtool: 'source-map', stats: 'normal' }) }) }) describe('globalMutableWebpackConfig', () => { beforeEach(() => jest.resetModules()) test('should use production config and environment', () => { process.env.RAILS_ENV = 'production' process.env.NODE_ENV = 'production' const { globalMutableWebpackConfig: webpackConfig } = require('../index') expect(webpackConfig.output.path).toEqual(resolve('public', 'packs')) expect(webpackConfig.output.publicPath).toEqual('/packs/') expect(webpackConfig).toMatchObject({ devtool: 'source-map', stats: 'normal' }) }) }) })
Version data entries
14 entries across 14 versions & 1 rubygems