From 2e7088d32fc4c4aa086185b4189434d6e95dc116 Mon Sep 17 00:00:00 2001 From: Jared Murrell Date: Sat, 9 Jan 2021 18:46:35 -0500 Subject: [PATCH] updated YAML tests for js-yaml 4 --- test/RallyValidate.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/RallyValidate.test.js b/test/RallyValidate.test.js index d77059a..cc31caf 100644 --- a/test/RallyValidate.test.js +++ b/test/RallyValidate.test.js @@ -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: { @@ -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() })