Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(file-list): revert "do not preprocess up-to-date files" (#3226) #3230

Merged
merged 1 commit into from
Dec 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions lib/file-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ class FileList {
return Promise.resolve(file)
}

const prevFile = this._findFile(path, patternObject)
if (prevFile && file.mtime <= prevFile.mtime) {
log.debug(`Not preprocessing "${path}" as file hasn't been changed since the last preprocessing`)
return Promise.resolve(prevFile)
}

return this._preprocess(file).then(() => file)
})
.then((files) => {
Expand Down
8 changes: 1 addition & 7 deletions test/unit/file-list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,9 @@ describe('FileList', () => {
})
})

it('preprocesses new and/or changed files', () => {
it('preprocesses all files', () => {
return list.refresh().then((files) => {
expect(preprocess.callCount).to.be.eql(5)
preprocess.resetHistory()
mg.statCache['/some/a.js'].mtime++
return list.refresh().then((files) => {
expect(preprocess.callCount).to.be.eql(1)
mg.statCache['/some/a.js'].mtime--
})
})
})

Expand Down