mirror of https://github.com/status-im/metro.git
Bust jest caching and fix tests
This commit is contained in:
parent
a457202f9b
commit
cf1a313d5c
|
@ -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;
|
|
@ -52,6 +52,14 @@ describe('JSTransformer Cache', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
pit('supports storing multiple fields', () => {
|
pit('supports storing multiple fields', () => {
|
||||||
|
require('fs').stat.mockImpl((file, callback) => {
|
||||||
|
callback(null, {
|
||||||
|
mtime: {
|
||||||
|
getTime: () => {}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
var cache = new Cache({
|
var cache = new Cache({
|
||||||
projectRoots: ['/rootDir'],
|
projectRoots: ['/rootDir'],
|
||||||
transformModulePath: 'x.js',
|
transformModulePath: 'x.js',
|
||||||
|
|
Loading…
Reference in New Issue