Sha256: 2e0583a45ea06ec3a30dc9ca1932222bb72deb4030613ee9ec2f80dca5965407

Contents?: true

Size: 1.2 KB

Versions: 25

Compression:

Stored size: 1.2 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_SERVE', () => {
      process.env.RAILS_ENV = 'development'
      process.env.NODE_ENV = 'development'
      process.env.WEBPACK_SERVE = 'true'
      const { webpackConfig } = require('../index')

      expect(webpackConfig.output.path).toEqual(resolve('public', 'packs'))
      expect(webpackConfig.output.publicPath).toEqual('/packs/')
    })

    test('should use development config and environment if WEBPACK_SERVE', () => {
      process.env.RAILS_ENV = 'development'
      process.env.NODE_ENV = 'development'
      process.env.WEBPACK_SERVE = 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

25 entries across 25 versions & 2 rubygems

Version Path
shakapacker-6.6.0 package/__tests__/development.js
shakapacker-6.5.6 package/__tests__/development.js
shakapacker-6.5.5 package/__tests__/development.js
shakapacker-6.5.4 package/__tests__/development.js
shakapacker-6.5.3 package/__tests__/development.js
shakapacker-6.5.2 package/__tests__/development.js
shakapacker-6.5.1 package/__tests__/development.js
shakapacker-6.5.0 package/__tests__/development.js
shakapacker-6.4.1 package/__tests__/development.js
shakapacker-6.4.0 package/__tests__/development.js
shakapacker-6.3.0 package/__tests__/development.js
shakapacker-6.3.0.pre.rc.1 package/__tests__/development.js
shakapacker-6.2.1 package/__tests__/development.js
shakapacker-6.2.0 package/__tests__/development.js
shakapacker-6.1.1 package/__tests__/development.js
shakapacker-6.1.0 package/__tests__/development.js
shakapacker-6.1.0.beta.0 package/__tests__/development.js
shakapacker-6.0.2 package/__tests__/development.js
shakapacker-6.0.1 package/__tests__/development.js
shakapacker-6.0.0 package/__tests__/development.js