Skip to content

Commit

Permalink
bundle and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBirki committed Dec 6, 2024
1 parent b1a479d commit 70904c4
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 23 deletions.
11 changes: 8 additions & 3 deletions __tests__/functions/params.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,15 @@ test('it parses boolean values correctly', async () => {
})

test('it parses nested objects correctly', async () => {
const parsed = parseParams('LOG_LEVEL=debug --config.db.host=localhost --config.db.port=5432')
const parsed = parseParams(
'LOG_LEVEL=debug --config.db.host=localhost --config.db.port=5432'
)
expect(parsed).toHaveProperty('config', {db: {host: 'localhost', port: 5432}})
expect(parsed).toHaveProperty('_', ["LOG_LEVEL=debug"])
expect(parsed).toStrictEqual({config: {db: {host: 'localhost', port: 5432}}, _: ["LOG_LEVEL=debug"]})
expect(parsed).toHaveProperty('_', ['LOG_LEVEL=debug'])
expect(parsed).toStrictEqual({
config: {db: {host: 'localhost', port: 5432}},
_: ['LOG_LEVEL=debug']
})
})

test('it parses a real world example correctly', async () => {
Expand Down
32 changes: 17 additions & 15 deletions __tests__/functions/post-deploy-message.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,24 @@ beforeEach(() => {
review_decision = 'APPROVED'
fork = false
params = 'LOG_LEVEL=debug --config.db.host=localhost --config.db.port=5432'
parsed_params = JSON.stringify({config: {db: {host: 'localhost', port: 5432}}, _: ["LOG_LEVEL=debug"]}),

context = {
actor: 'monalisa',
eventName: 'issue_comment',
workflow: 'test-workflow',
repo: {
owner: 'corp',
repo: 'test'
},
payload: {
comment: {
id: '1'
;(parsed_params = JSON.stringify({
config: {db: {host: 'localhost', port: 5432}},
_: ['LOG_LEVEL=debug']
})),
(context = {
actor: 'monalisa',
eventName: 'issue_comment',
workflow: 'test-workflow',
repo: {
owner: 'corp',
repo: 'test'
},
payload: {
comment: {
id: '1'
}
}
}
}
})

data = {
environment: environment,
Expand Down
5 changes: 4 additions & 1 deletion __tests__/functions/post-deploy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ beforeEach(() => {
review_decision: review_decision,
fork: 'false',
params: 'LOG_LEVEL=debug --config.db.host=localhost --config.db.port=5432',
parsed_params: JSON.stringify({config: {db: {host: 'localhost', port: 5432}}, _: ["LOG_LEVEL=debug"]}),
parsed_params: JSON.stringify({
config: {db: {host: 'localhost', port: 5432}},
_: ['LOG_LEVEL=debug']
})
}
})

Expand Down
5 changes: 4 additions & 1 deletion __tests__/functions/post.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ const validStates = {
review_decision: 'APPROVED',
fork: 'false',
params: 'LOG_LEVEL=debug --config.db.host=localhost --config.db.port=5432',
parsed_params: JSON.stringify({config: {db: {host: 'localhost', port: 5432}}, _: ["LOG_LEVEL=debug"]}),
parsed_params: JSON.stringify({
config: {db: {host: 'localhost', port: 5432}},
_: ['LOG_LEVEL=debug']
})
}

const setFailedMock = jest.spyOn(core, 'setFailed').mockImplementation(() => {})
Expand Down
21 changes: 19 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit 70904c4

Please sign in to comment.