Skip to content

Commit

Permalink
style(fauda): use process.env in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ngryman committed Nov 20, 2020
1 parent 6d0b84e commit 719740c
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/fauda.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ describe('given a JSON schema', () => {
args: [],
cwd: '',
env: {
...process.env,
MY_APP_PORT: '8080',
MY_APP_OPEN: 'true',
MY_APP_PUBLIC_PAGES: "['/home', '/about']",
NODE_ENV: 'development'
MY_APP_PUBLIC_PAGES: "['/home', '/about']"
}
}
const configuration = await fauda(
Expand All @@ -21,7 +21,7 @@ describe('given a JSON schema', () => {
)
expect(configuration).toMatchInlineSnapshot(`
Object {
"mode": "development",
"mode": "test",
"open": true,
"port": 8080,
"publicPages": Array [
Expand All @@ -40,14 +40,12 @@ describe('given a JSON schema', () => {
'--public-pages=/about'
],
cwd: '',
env: {
NODE_ENV: 'development'
}
env: process.env
}
const config = await fauda('my-app', 'test/fixtures/schema.json', options)
expect(config).toMatchInlineSnapshot(`
Object {
"mode": "development",
"mode": "test",
"open": true,
"port": 8080,
"publicPages": Array [
Expand All @@ -65,14 +63,12 @@ describe('given a JSON schema', () => {
const options: FaudaOptions = {
args: [],
cwd: testProject.rootDir,
env: {
NODE_ENV: 'development'
}
env: process.env
}
const config = await fauda('my-app', 'test/fixtures/schema.json', options)
expect(config).toMatchInlineSnapshot(`
Object {
"mode": "development",
"mode": "test",
"open": true,
"port": 8080,
"publicPages": Array [
Expand Down

0 comments on commit 719740c

Please # to comment.