Use a mock for FileWatcher

Reviewed By: davidaurelio

Differential Revision: D2628885

fb-gh-sync-id: f8b96c483eb7deb52a7ca4897801e2d0ef9e4f4c
This commit is contained in:
Christoph Pojer 2015-11-09 13:32:48 -08:00 committed by facebook-github-bot-7
parent 8c59866b69
commit 44b051d98d
3 changed files with 13 additions and 4 deletions

View File

@ -13,7 +13,6 @@ jest
.dontMock('../fastfs')
.dontMock('../replacePatterns')
.dontMock('../DependencyGraph/docblock')
.dontMock('../../FileWatcher')
.dontMock('../Module');
jest
@ -24,10 +23,12 @@ var Module = require('../Module');
var ModuleCache = require('../ModuleCache');
var Promise = require('promise');
var fs = require('fs');
var FileWatcher = require('../../FileWatcher');
describe('Module', () => {
const fileWatcher = new FileWatcher(['/root']);
const fileWatcher = {
on: () => this,
isWatchman: () => Promise.resolve(false),
};
describe('Async Dependencies', () => {
function expectAsyncDependenciesToEqual(expected) {

View File

@ -1,3 +1,11 @@
/**
* 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';
const Promise = require('promise');

View File

@ -81,7 +81,7 @@ fs.stat.mockImpl(function(filepath, callback) {
var mtime = {
getTime: function() {
return Math.ceil(Math.random() * 10000000);
}
},
};
if (node.SYMLINK) {