Bust jest caching and fix tests

This commit is contained in:
Christopher Chedeau 2015-08-11 10:25:39 -07:00
parent a457202f9b
commit cf1a313d5c
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,20 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
class Cache {
get(filepath, field, cb) {
return cb(filepath);
}
invalidate(filepath) { }
end() { }
}
module.exports = Cache;

View File

@ -52,6 +52,14 @@ describe('JSTransformer Cache', () => {
});
pit('supports storing multiple fields', () => {
require('fs').stat.mockImpl((file, callback) => {
callback(null, {
mtime: {
getTime: () => {}
}
});
});
var cache = new Cache({
projectRoots: ['/rootDir'],
transformModulePath: 'x.js',