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