Skip to content

Commit 8792be9

Browse files
decyjphrCopilot
andcommitted
Upgrade js-yaml
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 585ba6f commit 8792be9

3 files changed

Lines changed: 52 additions & 70 deletions

File tree

package-lock.json

Lines changed: 16 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@probot/adapter-aws-lambda-serverless": "^4.0.3",
3030
"deepmerge": "^4.3.1",
3131
"eta": "^3.5.0",
32-
"js-yaml": "^5.2.2",
32+
"js-yaml": "^3.15.0",
3333
"lodash": "^4.18.1",
3434
"minimatch": "^10.2.1",
3535
"node-cron": "^4.2.1",

test/unit/yaml-smoke.test.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const fs = require('fs')
2+
const path = require('path')
3+
const yaml = require('js-yaml')
4+
5+
const repoRoot = path.join(__dirname, '..', '..')
6+
const files = [
7+
'docs/sample-settings/settings.yml',
8+
'docs/sample-settings/sample-deployment-settings.yml',
9+
'docs/sample-settings/repo.yml',
10+
'docs/sample-settings/suborg.yml',
11+
'test/fixtures/teams-config.yml',
12+
'test/fixtures/repository-config.yml'
13+
]
14+
15+
describe('js-yaml smoke test', () => {
16+
test('js-yaml resolves to the patched 3.15.x line', () => {
17+
expect(require('js-yaml/package.json').version).toMatch(/^3\.15\./)
18+
})
19+
20+
test.each(files)('parses sample config %s', (f) => {
21+
const parsed = yaml.load(fs.readFileSync(path.join(repoRoot, f), 'utf8'))
22+
expect(parsed).toBeTruthy()
23+
})
24+
25+
test('merge keys resolve correctly', () => {
26+
const doc = yaml.load('base: &b { x: 1, y: 2 }\nchild:\n <<: *b\n z: 3\n')
27+
expect(doc.child).toEqual({ x: 1, y: 2, z: 3 })
28+
})
29+
30+
test('app config-loading modules require cleanly', () => {
31+
expect(() => require('../../lib/configManager')).not.toThrow()
32+
expect(() => require('../../lib/settings')).not.toThrow()
33+
expect(() => require('../../lib/deploymentConfig')).not.toThrow()
34+
})
35+
})

0 commit comments

Comments
 (0)