Skip to content

Commit f06b569

Browse files
committed
✅ test: fix test errors
1 parent e75546f commit f06b569

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Details changes for each release are documented in the [CHANGELOG.md](https://gi
2525
- [x] no-dynamic-keys
2626
- [x] no-unused-keys
2727
- [x] no-v-html
28-
- [ ] no-html-message
28+
- [x] no-html-message
2929
- [ ] no-raw-text
3030
- [ ] valid-message-syntax
3131
- [ ] keys-order

lib/utils/glob-utils.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ function listFilesToProcess (globPatterns, providedOptions) {
127127
const options = providedOptions || { ignore: true }
128128
const cwd = options.cwd || process.cwd()
129129

130-
const getIgnorePaths = lodash.memoize(
131-
optionsObj => new IgnoredPaths(optionsObj)
132-
)
130+
const getIgnorePaths = optionsObj => new IgnoredPaths(optionsObj)
133131

134132
/*
135133
* The test "should use default options if none are provided" (source-code-utils.js) checks that 'module.exports.resolveFileGlobPatterns' was called.

lib/utils/ignored-paths.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ const DEFAULT_IGNORE_DIRS = [
2525
'/bower_components/*'
2626
]
2727
const DEFAULT_OPTIONS = {
28-
dotfiles: false,
29-
cwd: process.cwd()
28+
dotfiles: false
3029
}
3130

3231
/**
@@ -58,7 +57,12 @@ function findPackageJSONFile (cwd) {
5857
* Merge options with defaults
5958
*/
6059
function mergeDefaultOptions (options) {
61-
return Object.assign({}, DEFAULT_OPTIONS, options)
60+
const mergedOptions = Object.assign({}, DEFAULT_OPTIONS, options)
61+
if (!mergedOptions.cwd) {
62+
mergedOptions.cwd = process.cwd()
63+
}
64+
debug('mergeDefaultOptions: mergedOptions = %j', mergedOptions)
65+
return mergedOptions
6266
}
6367

6468
/* eslint-disable valid-jsdoc */
@@ -254,7 +258,9 @@ class IgnoredPaths {
254258
this._baseDir += '\\'
255259
}
256260

257-
debug('baseDir = %j', this._baseDir)
261+
debug('set baseDir = %j', this._baseDir)
262+
} else {
263+
debug('alredy set baseDir = %j', this._baseDir)
258264
}
259265
return this._baseDir
260266
}

tests/lib/rules/no-unused-keys.js

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ describe('no-unused-keys', () => {
2525
})
2626

2727
after(() => {
28+
Module._resolveFilename = resolveFilename
2829
process.chdir(originalCwd)
2930
})
3031

0 commit comments

Comments
 (0)