Sha256: e76d37e382dd023b4af613fd09fb7a3dd7e052b59f36fa6ceec3d002f4bbba09

Contents?: true

Size: 793 Bytes

Versions: 11

Compression:

Stored size: 793 Bytes

Contents

/* test expect, describe, afterAll, beforeEach */

const { resolve } = require('path')
const { chdirTestApp, chdirCwd } = require('../utils/helpers')

chdirTestApp()

describe('Custom environment', () => {
  afterAll(chdirCwd)

  describe('toWebpackConfig', () => {
    beforeEach(() => jest.resetModules())

    test('should use staging config and production environment', () => {
      process.env.RAILS_ENV = 'staging'
      const { environment } = require('../index')

      const config = environment.toWebpackConfig()
      expect(config.output.path).toEqual(resolve('public', 'packs-staging'))
      expect(config.output.publicPath).toEqual('/packs-staging/')
      expect(config).toMatchObject({
        devtool: 'nosources-source-map',
        stats: 'normal'
      })
    })
  })
})

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
optimacms-0.4.3 spec/dummy/node_modules/@rails/webpacker/package/__tests__/staging.js
optimacms-0.4.2 spec/dummy/node_modules/@rails/webpacker/package/__tests__/staging.js
webpacker-3.5.3 package/__tests__/staging.js
webpacker-3.5.2 package/__tests__/staging.js
webpacker-3.5.1 package/__tests__/staging.js
webpacker-3.5.0 package/__tests__/staging.js
webpacker-3.4.3 package/__tests__/staging.js
webpacker-4.0.0.pre.pre.2 package/__tests__/staging.js
webpacker-4.0.0.pre.pre.1 package/__tests__/staging.js
webpacker-3.4.1 package/__tests__/staging.js
webpacker-3.4.0 package/__tests__/staging.js