Sha256: e4ce8f4cbe9b2f35a90f675b5ad5176b5b9eac6dc43e6baadb806881387e1aae
Contents?: true
Size: 1.16 KB
Versions: 87
Compression:
Stored size: 1.16 KB
Contents
/* global test expect, describe */ const { chdirTestApp, chdirCwd } = require('../utils/helpers') chdirTestApp() describe('Env', () => { beforeEach(() => jest.resetModules()) afterAll(chdirCwd) test('with NODE_ENV and RAILS_ENV set to development', () => { process.env.RAILS_ENV = 'development' process.env.NODE_ENV = 'development' expect(require('../env')).toEqual({ railsEnv: 'development', nodeEnv: 'development' }) }) test('with undefined NODE_ENV and RAILS_ENV set to development', () => { process.env.RAILS_ENV = 'development' delete process.env.NODE_ENV expect(require('../env')).toEqual({ railsEnv: 'development', nodeEnv: 'production' }) }) test('with undefined NODE_ENV and RAILS_ENV', () => { delete process.env.NODE_ENV delete process.env.RAILS_ENV expect(require('../env')).toEqual({ railsEnv: 'production', nodeEnv: 'production' }) }) test('with a non-standard environment', () => { process.env.RAILS_ENV = 'staging' process.env.NODE_ENV = 'staging' expect(require('../env')).toEqual({ railsEnv: 'staging', nodeEnv: 'production' }) }) })
Version data entries
87 entries across 86 versions & 12 rubygems