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

Commit

Permalink
updated YAML tests for js-yaml 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared Murrell committed Jan 9, 2021
1 parent f08ae4c commit 2e7088d
Showing 1 changed file with 4 additions and 4 deletions.
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 2e7088d

Please sign in to comment.