From bf6953f2cf9a4405a8d23037b98b69eccb145ed5 Mon Sep 17 00:00:00 2001 From: "Geerts, Ryan J" Date: Fri, 17 Jul 2020 09:58:58 -0500 Subject: [PATCH] improvement(test-util): use more sensitive language for less privileged groups blm --- package.json | 2 +- packages/create-instance/patch-create-element.js | 6 +++--- test/setup/webpack.test.config.js | 4 ++-- test/specs/mounting-options/stubs.spec.js | 6 +++--- yarn.lock | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 4e2719338..250af35a4 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "vuepress-theme-vue": "^1.0.3", "vuex": "^3.0.1", "webpack": "^3.0.1", - "webpack-node-externals": "^1.6.0" + "webpack-node-externals": "^2.5.0" }, "devDependencies": { "@commitlint/cli": "^8.2.0", diff --git a/packages/create-instance/patch-create-element.js b/packages/create-instance/patch-create-element.js index dc152996e..02b7d1256 100644 --- a/packages/create-instance/patch-create-element.js +++ b/packages/create-instance/patch-create-element.js @@ -11,7 +11,7 @@ import { CREATE_ELEMENT_ALIAS } from 'shared/consts' -const isWhitelisted = (el, whitelist) => resolveComponent(el, whitelist) +const isAllowlisted = (el, allowlist) => resolveComponent(el, allowlist) const isAlreadyStubbed = (el, stubs) => stubs.has(el) function shouldExtend(component, _Vue) { @@ -36,10 +36,10 @@ function createStubIfNeeded(shouldStub, component, _Vue, el) { } } -function shouldNotBeStubbed(el, whitelist, modifiedComponents) { +function shouldNotBeStubbed(el, allowlist, modifiedComponents) { return ( (typeof el === 'string' && isReservedTag(el)) || - isWhitelisted(el, whitelist) || + isAllowlisted(el, allowlist) || isAlreadyStubbed(el, modifiedComponents) ) } diff --git a/test/setup/webpack.test.config.js b/test/setup/webpack.test.config.js index f92d35b8e..a391e9e0a 100644 --- a/test/setup/webpack.test.config.js +++ b/test/setup/webpack.test.config.js @@ -19,8 +19,8 @@ const rules = [].concat( } ) const externals = nodeExternals({ - // we need to whitelist both `create-instance` and files in `shared` package. Otherwise webpack won't bundle them in the test dev env - whitelist: [ + // we need to allowlist both `create-instance` and files in `shared` package. Otherwise webpack won't bundle them in the test dev env + allowlist: [ '@vue/test-utils', '@vue/server-test-utils', 'create-instance', diff --git a/test/specs/mounting-options/stubs.spec.js b/test/specs/mounting-options/stubs.spec.js index da081bb38..41d8a0418 100644 --- a/test/specs/mounting-options/stubs.spec.js +++ b/test/specs/mounting-options/stubs.spec.js @@ -133,7 +133,7 @@ describeWithShallowAndMount('options.stub', mountingMethod => { expect(wrapper.html()).to.contain('') }) - it('stubs components with dummy when passed as an array', () => { + it('stubs components with place holder when passed as an array', () => { const ComponentWithGlobalComponent = { render: h => h('div', [h('registered-component')]) } @@ -230,7 +230,7 @@ describeWithShallowAndMount('options.stub', mountingMethod => { expect(wrapper.html()).to.contain('') }) - it('stubs components with dummy which has name when passed a boolean', () => { + it('stubs components with place holder which has name when passed a boolean', () => { const ComponentWithGlobalComponent = { render: h => h('div', [h('registered-component')]) } @@ -243,7 +243,7 @@ describeWithShallowAndMount('options.stub', mountingMethod => { expect(wrapper.html()).to.contain('') }) - it('stubs components with dummy when passed as an array', () => { + it('stubs components with place holder when passed as an array', () => { const ComponentWithGlobalComponent = { render: h => h('registered-component') } diff --git a/yarn.lock b/yarn.lock index 18a5a5980..5636fe02c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13175,9 +13175,9 @@ webpack-merge@^4.1.2: dependencies: lodash "^4.17.5" -webpack-node-externals@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/webpack-node-externals/-/webpack-node-externals-1.6.0.tgz#232c62ec6092b100635a3d29d83c1747128df9bd" +webpack-node-externals@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/webpack-node-externals/-/webpack-node-externals-2.5.0.tgz#8d50f3289c71bc2b921a8da228e0b652acc503f1" webpack-serve@^1.0.2: version "1.0.4"