Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #221 from github/dependabot/npm_and_yarn/js-yaml-4…
Browse files Browse the repository at this point in the history
….0.0

Bump js-yaml from 3.14.0 to 4.0.0
  • Loading branch information
Jared Murrell authored Jan 9, 2021
2 parents fb7913e + 2e7088d commit 668b9c1
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/RallyValidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class RallyValidate {
} else {
// Config file found, need to parse variables
const orgConfigString = Buffer.from(orgConfigResponse.data.content, 'base64').toString('ascii')
orgConfig = yaml.safeLoad(orgConfigString)
orgConfig = yaml.load(orgConfigString)
}

return orgConfig
Expand Down
94 changes: 83 additions & 11 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"outdent": "^0.8.0",
"probot": "^9.14.1",
"rally": "^2.1.3",
"js-yaml": "^3.14.0"
"js-yaml": "^4.0.0"
},
"devDependencies": {
"jest": "^26.6.3",
Expand Down
8 changes: 4 additions & 4 deletions test/RallyValidate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ describe('JiraIssueValidate', () => {

handler = new RallyValidate(robot)

const configFile = yaml.safeLoad(fs.readFileSync('./rally.yml'))
const probotConfigEncodedYaml = Buffer.from(yaml.safeDump(configFile)).toString('base64')
const configFile = yaml.load(fs.readFileSync('./rally.yml'))
const probotConfigEncodedYaml = Buffer.from(yaml.dump(configFile)).toString('base64')
context = {
config: jest.fn().mockImplementation(() => Promise.resolve(configFile)),
github: {
Expand Down Expand Up @@ -94,14 +94,14 @@ describe('JiraIssueValidate', () => {

describe('set artifacts to complete on pr merge', () => {
it('doesn\'t attempt a status change when mergeOnPRBody is set to false in config', async () => {
const configFile = yaml.safeLoad(fs.readFileSync('./rally.yml'))
const configFile = yaml.load(fs.readFileSync('./rally.yml'))
configFile.mergeOnPRBody = false
await handler.closeArtifactsFromPRBody(context, configFile, rallyClient)
expect(rallyClient.update).not.toHaveBeenCalled()
})

it('sets status to completed when mergeOnPRBody is set to true in config', async () => {
const configFile = yaml.safeLoad(fs.readFileSync('./rally.yml'))
const configFile = yaml.load(fs.readFileSync('./rally.yml'))
await handler.closeArtifactsFromPRBody(context, configFile, rallyClient)
expect(rallyClient.update).toHaveBeenCalled()
})
Expand Down

0 comments on commit 668b9c1

Please sign in to comment.