Skip to content

Commit

Permalink
Merge pull request #276 from iambumblehead/update-lint-disallow-trail…
Browse files Browse the repository at this point in the history
…ing-whitespace

update eslint disallow trailing whitespace
  • Loading branch information
iambumblehead authored Nov 13, 2023
2 parents 88a7216 + 3b7a609 commit ba148ee
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"Set": true
},
"rules": {
"no-trailing-spaces": [2],
"no-unused-vars": [ "error", {
"vars": "all",
"args": "after-used",
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* 2.6.1 _???.??.2023_
* [update README to work w/ eslint-plugin-markdown](https://github.com/iambumblehead/esmock/pull/275)
* [update eslint](https://github.com/iambumblehead/esmock/pull/276) disallow trailing whitespace
* 2.6.0 _Nov.07.2023_
* [typings: make MockFunction generic,](https://github.com/iambumblehead/esmock/pull/267) thanks @uwinkelvos
* 2.5.9 _Nov.01.2023_
Expand Down
2 changes: 1 addition & 1 deletion src/esmock.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ export {
type MockFunction,
type MockMap,
type Options,
type Resolver
type Resolver
}
2 changes: 1 addition & 1 deletion src/esmockModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const isJSONExtnRe = /\.json$/i

// assigning the object to its own prototypal inheritor can error, eg
// 'Cannot assign to read only property \'F_OK\' of object \'#<Object>\''
//
//
// if not plain obj, assign enumerable vals only. core modules === plain obj
const esmockModuleMerge = (defLive, def) => isPlainObj(defLive)
? Object.assign({}, defLive, def)
Expand Down
2 changes: 1 addition & 1 deletion tests/local/pnp/enable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function resolve (specifier, context, next) {
? '../tests/local/pnp/api.js'
: specifier, context)
}

module.register && (process.versions.pnp = '3') && module.register(`
data:text/javascript,
export ${encodeURIComponent(resolve)}`.slice(1))
2 changes: 1 addition & 1 deletion tests/tests-node/esmock.node.resolver-pnp.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test.beforeEach(() => {
test('should work with pnp resolver', async ({ mock }) => {
if (!module.register)
return assert.ok('skip test')

pnpapi.resolveRequest = mock.fn(resolver)

const main = await esmock('../local/main.js', {
Expand Down
4 changes: 2 additions & 2 deletions tests/tests-node/esmock.node.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ test('should mock imported json', async () => {

if (/^(18|20)$/.test(process.versions.node.split('.')[0]))
return assert.ok(true)

assert.strictEqual(
Object.keys(importsJSON.JSONobj).sort().join(), 'example,test-example')
assert.strictEqual(importsJSON.JSONobj['test-example'], 'test-json-a')
Expand All @@ -576,7 +576,7 @@ test('should mock imported json (strict)', async () => {

if (/^(18|20)$/.test(process.versions.node.split('.')[0]))
return assert.ok(true)

assert.strictEqual(
Object.keys(importsJSON.JSONobj).sort().join(), 'test-example')
assert.strictEqual(importsJSON.JSONobj['test-example'], 'test-json-b')
Expand Down

0 comments on commit ba148ee

Please sign in to comment.