Sha256: 67112991b2e2d1d98fd067f3495ed7d7118bf009a8f07728c285e9f00ddc2921
Contents?: true
Size: 1.5 KB
Versions: 14
Compression:
Stored size: 1.5 KB
Contents
/* global test expect, describe */ const { chdirTestApp } = require('../utils/helpers') const rootPath = process.cwd() chdirTestApp() describe('DevServer', () => { beforeEach(() => jest.resetModules()) afterAll(() => process.chdir(rootPath)) test('with NODE_ENV and RAILS_ENV set to development', () => { process.env.NODE_ENV = 'development' process.env.RAILS_ENV = 'development' process.env.SHAKAPACKER_DEV_SERVER_HOST = '0.0.0.0' process.env.SHAKAPACKER_DEV_SERVER_PORT = 5000 process.env.SHAKAPACKER_DEV_SERVER_DISABLE_HOST_CHECK = false const devServer = require('../dev_server') expect(devServer).toBeDefined() expect(devServer.host).toEqual('0.0.0.0') expect(devServer.port).toEqual('5000') expect(devServer.disable_host_check).toBe(false) }) test('with custom env prefix', () => { const config = require('../config') config.dev_server.env_prefix = 'TEST_SHAKAPACKER_DEV_SERVER' process.env.NODE_ENV = 'development' process.env.RAILS_ENV = 'development' process.env.TEST_SHAKAPACKER_DEV_SERVER_HOST = '0.0.0.0' process.env.TEST_SHAKAPACKER_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 and RAILS_ENV set to production', () => { process.env.RAILS_ENV = 'production' process.env.NODE_ENV = 'production' expect(require('../dev_server')).toEqual({}) }) })
Version data entries
14 entries across 14 versions & 1 rubygems