Sha256: ef1826de2a22a95e11d89f5529c9e0740b969f49b640d5bd3a3380ec29f5b156

Contents?: true

Size: 729 Bytes

Versions: 2

Compression:

Stored size: 729 Bytes

Contents

/* global test expect, describe */

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

chdirTestApp()

describe('DevServer', () => {
  beforeEach(() => jest.resetModules())
  afterAll(chdirCwd)

  test('with NODE_ENV set to development', () => {
    process.env.NODE_ENV = 'development'
    process.env.WEBPACKER_DEV_SERVER_HOST = '0.0.0.0'
    process.env.WEBPACKER_DEV_SERVER_PORT = 5000

    const devServer = require('../dev_server')
    expect(devServer).toBeDefined()
    expect(devServer.host).toEqual('0.0.0.0')
    expect(devServer.port).toEqual('5000')
  })

  test('with NODE_ENV set to production', () => {
    process.env.NODE_ENV = 'production'
    expect(require('../dev_server')).toEqual({})
  })
})

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
webpacker-3.3.1 package/__tests__/dev_server.js
webpacker-3.3.0 package/__tests__/dev_server.js