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