Skip to content

Commit

Permalink
fix: suppress warning in ci/cd pipeline (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak authored Oct 11, 2023
1 parent 591de9e commit 464500f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"build": "ncc build src/index.js",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "tap",
"prepare": "husky install"
},
Expand Down
21 changes: 17 additions & 4 deletions test/util.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
'use strict'
const tap = require('tap')
const {
getInputs,
parseCommaOrSemicolonSeparatedValue,
} = require('../src/util')
const sinon = require('sinon')

const logWarningStub = sinon.stub()
const { getInputs, parseCommaOrSemicolonSeparatedValue } = tap.mockRequire(
'../src/util',
{
'../src/log.js': {
logWarning: logWarningStub,
},
}
)

tap.test('parseCommaOrSemicolonSeparatedValue', async t => {
t.test('should split semicolon separated values correctly', async t => {
Expand Down Expand Up @@ -55,10 +62,16 @@ tap.test('getInputs', async t => {
t.test('MERGE_METHOD', async t => {
t.equal(getInputs({}).MERGE_METHOD, 'squash')
t.equal(getInputs({ 'merge-method': 'merge' }).MERGE_METHOD, 'merge')
t.equal(logWarningStub.callCount, 0)
t.equal(
getInputs({ 'merge-method': 'invalid-merge-method' }).MERGE_METHOD,
'squash'
)
t.equal(logWarningStub.callCount, 1)
t.equal(
logWarningStub.firstCall.args[0],
'merge-method input is ignored because it is malformed, defaulting to `squash`.'
)
})
t.test('EXCLUDE_PKGS', async t => {
t.same(getInputs({ exclude: 'react,vue' }).EXCLUDE_PKGS, [
Expand Down

0 comments on commit 464500f

Please sign in to comment.