-
Notifications
You must be signed in to change notification settings - Fork 129
Move to npm run test in vscode launch config #1013
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The non-test launch projects still fail.
@@ -9,16 +9,17 @@ import * as nuget from '@snyk/nuget-semver' | |||
import * as os from 'os' | |||
import * as ppath from 'path' | |||
import * as xp from 'xml2js' | |||
import Validator from 'ajv' | |||
import glob from 'globby' | |||
import Ajv = require('ajv'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is discussed here: ajv-validator/ajv#1230
It looks like upgrading to v7 would give us better ES import support, but it's not a trivial upgrade so I'm moving back to require for this (and globby
which appears to have a similar problem).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AJV v7 beta has better support for ES style import but is not a trivial upgrade to make. This commit also upgrades `tslib` across all packages to maintain consistency with latest typescript version.
0a4ee6c
to
c0b9a20
Compare
@@ -82,11 +81,15 @@ export class SchemaTracker { | |||
this.validator.addSchema(metaSchema, metaSchemaName) | |||
} | |||
this.validator.addSchema(fullSchema, schemaPath) | |||
validator = this.validator.getSchema(schemaPath) as ajv.ValidateFunction | |||
validator = this.validator.getSchema(schemaPath) | |||
if (!validator) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds a bit of safety rather than relying on casting to implicitly remove the potential for an undefined result.
Fixes issues with package resolution.