-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ca372d
commit 651f812
Showing
7 changed files
with
47 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
process.env.NODE_ENV = process.env.NODE_ENV || 'development' | ||
|
||
const environment = require('./environment') | ||
|
||
module.exports = environment.toWebpackConfig() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* test expect, describe, afterAll, beforeEach */ | ||
|
||
const { resolve } = require('path') | ||
const { chdirTestApp, chdirCwd } = require('../utils/helpers') | ||
|
||
chdirTestApp() | ||
|
||
describe('Test environment', () => { | ||
afterAll(chdirCwd) | ||
|
||
describe('toWebpackConfig', () => { | ||
beforeEach(() => jest.resetModules()) | ||
|
||
test('should use test config and production environment', () => { | ||
process.env.RAILS_ENV = 'test' | ||
process.env.NODE_ENV = 'test' | ||
|
||
const { environment } = require('../index') | ||
const config = environment.toWebpackConfig() | ||
|
||
expect(config.output.path).toEqual(resolve('public', 'packs-test')) | ||
expect(config.output.publicPath).toEqual('/packs-test/') | ||
expect(config.devServer).toEqual(undefined) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const Base = require('./base') | ||
|
||
module.exports = class extends Base {} |