-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: refactor config tests service name #3777
Conversation
const test = require('tape'); | ||
|
||
const { normalize } = require('../../lib/config/config'); | ||
const { CONFIG_SCHEMA, getDefaultOptions } = require('../../lib/config/schema'); | ||
|
||
const { runTestFixtures } = require('../_utils'); | ||
const { reviver, replacer } = require('./_json-utils.js'); | ||
const { reviver, replacer } = require('./json-utils.js'); |
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.
Note for reviewer: nit from the previous PR #3768
@@ -448,7 +452,7 @@ const testFixtures = [ | |||
t.deepEqual( | |||
resolvedConfig.globalLabels, | |||
pairs, | |||
'globalLabels is parsed correctly from environment (array)', | |||
'globalLabels is parsed correctly from start options (array)', |
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.
Note for reviewer: nit from the previous PR #3768
@@ -577,7 +581,7 @@ const testFixtures = [ | |||
t.deepEqual( | |||
resolvedConfig.ignoreUrlStr, | |||
['str1'], | |||
'string items of ignoreUrl are added to the right config (ignoreUrlStr)', | |||
'string items of ignoreUrls are added to the right config (ignoreUrlStr)', |
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.
Note for reviewer: nit from the previous PR #3768
{ | ||
name: 'pkg-zero-conf-none - serviceName/serviceVersion resolved to unknown if no package.json present', | ||
script: (function () { | ||
const path = require('path'); |
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.
Note for reviewer: when this iife executes the requires at the top are not resolved yet. So we need to these ones
This PR is refactoring all test related to the resolution of the service name and version. It also moves the
test/fixtures/pkg-zero-conf-*
folders used to test intotest/config/fixtures
folder to keep al related files in the same scope.Checklist