Skip to content

Commit

Permalink
improvement(test-util): use more sensitive language for less privileg…
Browse files Browse the repository at this point in the history
…ed (#1615)

groups blm
  • Loading branch information
rgeerts committed Jul 21, 2020
1 parent 192556c commit f4083fa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions packages/create-instance/patch-create-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
)
}
Expand Down
4 changes: 2 additions & 2 deletions test/setup/webpack.test.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 3 additions & 3 deletions test/specs/mounting-options/stubs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ describeWithShallowAndMount('options.stub', mountingMethod => {
expect(wrapper.html()).to.contain('</div>')
})

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')])
}
Expand Down Expand Up @@ -230,7 +230,7 @@ describeWithShallowAndMount('options.stub', mountingMethod => {
expect(wrapper.html()).to.contain('<child-component-stub>')
})

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')])
}
Expand All @@ -243,7 +243,7 @@ describeWithShallowAndMount('options.stub', mountingMethod => {
expect(wrapper.html()).to.contain('<registered-component-stub>')
})

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')
}
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13180,9 +13180,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"
Expand Down

0 comments on commit f4083fa

Please sign in to comment.