Updating js-yaml to 4.0

This commit is contained in:
David Diaz 2021-01-29 12:57:14 -06:00
parent d179f616d2
commit b7d18d517e
4 changed files with 20 additions and 14 deletions

View File

@ -18,7 +18,7 @@ class Base extends Command {
}
let config
yaml.safeLoadAll(fs.readFileSync(configFile, 'utf-8'), (doc) => {
yaml.loadAll(fs.readFileSync(configFile, 'utf-8'), (doc) => {
const valid = validate(doc)
if (!valid) {

12
package-lock.json generated
View File

@ -3820,7 +3820,8 @@
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz",
"integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=",
"dev": true
"dev": true,
"optional": true
},
"har-schema": {
"version": "2.0.0",
@ -7277,6 +7278,7 @@
"resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.1.tgz",
"integrity": "sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA==",
"dev": true,
"optional": true,
"requires": {
"growly": "^1.3.0",
"is-wsl": "^2.2.0",
@ -7291,6 +7293,7 @@
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
"dev": true,
"optional": true,
"requires": {
"lru-cache": "^6.0.0"
}
@ -7299,13 +7302,15 @@
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
"dev": true
"dev": true,
"optional": true
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"optional": true,
"requires": {
"isexe": "^2.0.0"
}
@ -8746,7 +8751,8 @@
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz",
"integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==",
"dev": true
"dev": true,
"optional": true
},
"signal-exit": {
"version": "3.0.2",

View File

@ -11,7 +11,7 @@ describe(`Beau's config Loader.`, () => {
it('should load the config', () => {
moduleVersion.mockReturnValue(1)
const doc = yaml.safeLoad(`
const doc = yaml.load(`
version: 1
endpoint: 'http://example.com'
@ -27,7 +27,7 @@ describe(`Beau's config Loader.`, () => {
it(`should load the request list using the configuration`, () => {
moduleVersion.mockReturnValue(1)
const doc = yaml.safeLoad(`
const doc = yaml.load(`
version: 1
endpoint: 'http://example.com'

View File

@ -6,7 +6,7 @@ requireg.resolving = false
describe('Config', () => {
it('should load valid config keys', () => {
const doc = yaml.safeLoad(`
const doc = yaml.load(`
version: 1
endpoint: http://martianwabbit.com
shouldntBeAdded: true
@ -19,7 +19,7 @@ describe('Config', () => {
})
it('should load requests', () => {
const doc = yaml.safeLoad(`
const doc = yaml.load(`
endpoint: http://example.com
GET /profile: get-profile
@ -36,7 +36,7 @@ describe('Config', () => {
})
it('should set up defaults for all requests', () => {
const doc = yaml.safeLoad(`
const doc = yaml.load(`
version: 1
endpoint: 'http://example.com'
@ -60,7 +60,7 @@ describe('Config', () => {
})
it('should load multiple hosts', () => {
const doc = yaml.safeLoad(`
const doc = yaml.load(`
version: 1
endpoint: http://example.org
@ -105,7 +105,7 @@ describe('Config', () => {
})
it('should namespace all aliases within an host', () => {
const doc = yaml.safeLoad(`
const doc = yaml.load(`
hosts:
- host: test1
endpoint: http://example.com
@ -122,7 +122,7 @@ describe('Config', () => {
})
it(`should throw if host doesn't have a host key`, () => {
const doc = yaml.safeLoad(`
const doc = yaml.load(`
hosts:
- endpoint: http://example.com
GET /posts: posts
@ -136,7 +136,7 @@ describe('Config', () => {
})
it(`should merge host settings with global settings`, () => {
const doc = yaml.safeLoad(`
const doc = yaml.load(`
defaults:
headers:
hello: 1
@ -159,7 +159,7 @@ describe('Config', () => {
})
it(`should allow different settings for the same request`, () => {
const doc = yaml.safeLoad(`
const doc = yaml.load(`
host: https://example.com
GET /1:
- alias: req1