Skip to content

Commit

Permalink
renaming in test cases (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzraho authored May 11, 2020
1 parent c3e8e30 commit dbaae0f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions generators/add-action/templates/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ describe('errorResponse', () => {
describe('stringParameters', () => {
test('no auth header', () => {
const params = {
a: 1, b: 2, __ow_headers: { 'x-api-key': 'yolo' }
a: 1, b: 2, __ow_headers: { 'x-api-key': 'fake-api-key' }
}
expect(utils.stringParameters(params)).toEqual(JSON.stringify(params))
})
test('with auth header', () => {
const params = {
a: 1, b: 2, __ow_headers: { 'x-api-key': 'yolo', authorization: 'secret' }
a: 1, b: 2, __ow_headers: { 'x-api-key': 'fake-api-key', authorization: 'secret' }
}
expect(utils.stringParameters(params)).toEqual(expect.stringContaining('"authorization":"<hidden>"'))
expect(utils.stringParameters(params)).not.toEqual(expect.stringContaining('secret'))
Expand Down
6 changes: 3 additions & 3 deletions test/generators/add-action/analytics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,16 @@ describe('run', () => {
assertDependencies()
})

test('user input actionName=yolo', async () => {
test('user input actionName=fakeAction', async () => {
const prevDotEnvContent = 'PREVIOUSCONTENT\n'
await helpers.run(theGeneratorPath)
.withOptions({ 'skip-prompt': false })
.withPrompts({ actionName: 'yolo' })
.withPrompts({ actionName: 'fakeAction' })
.inTmpDir(dir => {
fs.writeFileSync(path.join(dir, '.env'), prevDotEnvContent)
})

const actionName = 'yolo'
const actionName = 'fakeAction'

assertGeneratedFiles(actionName)
assertActionCodeContent(actionName)
Expand Down
6 changes: 3 additions & 3 deletions test/generators/add-action/campaign-standard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,16 @@ describe('run', () => {
assertDependencies()
})

test('user input actionName=yolo', async () => {
test('user input actionName=fakeAction', async () => {
const prevDotEnvContent = 'PREVIOUSCONTENT\n'
await helpers.run(theGeneratorPath)
.withOptions({ 'skip-prompt': false })
.withPrompts({ actionName: 'yolo' })
.withPrompts({ actionName: 'fakeAction' })
.inTmpDir(dir => {
fs.writeFileSync(path.join(dir, '.env'), prevDotEnvContent)
})

const actionName = 'yolo'
const actionName = 'fakeAction'

assertGeneratedFiles(actionName)
assertActionCodeContent(actionName)
Expand Down
6 changes: 3 additions & 3 deletions test/generators/add-action/customer-profile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,16 @@ describe('run', () => {
assertDependencies()
})

test('user input actionName=yolo', async () => {
test('user input actionName=fakeAction', async () => {
const prevDotEnvContent = 'PREVIOUSCONTENT\n'
await helpers.run(theGeneratorPath)
.withOptions({ 'skip-prompt': false })
.withPrompts({ actionName: 'yolo' })
.withPrompts({ actionName: 'fakeAction' })
.inTmpDir(dir => {
fs.writeFileSync(path.join(dir, '.env'), prevDotEnvContent)
})

const actionName = 'yolo'
const actionName = 'fakeAction'

assertGeneratedFiles(actionName)
assertActionCodeContent(actionName)
Expand Down
6 changes: 3 additions & 3 deletions test/generators/add-action/generic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ describe('run', () => {
assertDependencies()
})

test('user input actionName=yolo', async () => {
test('user input actionName=fakeAction', async () => {
await helpers.run(theGeneratorPath)
.withOptions({ 'skip-prompt': false })
.withPrompts({ actionName: 'yolo' })
.withPrompts({ actionName: 'fakeAction' })

const actionName = 'yolo'
const actionName = 'fakeAction'

assertGeneratedFiles(actionName)
assertActionCodeContent(actionName)
Expand Down
6 changes: 3 additions & 3 deletions test/generators/add-action/target.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,16 @@ describe('run', () => {
assertDependencies()
})

test('user input actionName=yolo', async () => {
test('user input actionName=fakeAction', async () => {
const prevDotEnvContent = 'PREVIOUSCONTENT\n'
await helpers.run(theGeneratorPath)
.withOptions({ 'skip-prompt': false })
.withPrompts({ actionName: 'yolo' })
.withPrompts({ actionName: 'fakeAction' })
.inTmpDir(dir => {
fs.writeFileSync(path.join(dir, '.env'), prevDotEnvContent)
})

const actionName = 'yolo'
const actionName = 'fakeAction'

assertGeneratedFiles(actionName)
assertActionCodeContent(actionName)
Expand Down

0 comments on commit dbaae0f

Please sign in to comment.