Permalink
Browse files

Fix tests + enable inline requires on react-native

Reviewed By: @sahrens, @vjeux

Differential Revision: D2456607
  • Loading branch information...
cpojer authored and facebook-github-bot-4 committed Sep 21, 2015
1 parent 6b733bd commit d088750163bd45cb60c4c6796ed97624fb6f91bf
@@ -68,7 +68,7 @@ describe('Activity', () => {
expect(() => {
Activity.endEvent(eid);
}).toThrow('event(3) has already ended!');
}).toThrow('event(1) has already ended!');
});
});
@@ -80,8 +80,8 @@ describe('Activity', () => {
Activity.signal(EVENT_NAME, DATA);
jest.runOnlyPendingTimers();
expect(console.log.mock.calls.length).toBe(3);
const consoleMsg = console.log.mock.calls[2][0];
expect(console.log.mock.calls.length).toBe(1);
const consoleMsg = console.log.mock.calls[0][0];
expect(consoleMsg).toContain(EVENT_NAME);
expect(consoleMsg).toContain(JSON.stringify(DATA));
});
@@ -21,13 +21,14 @@ jest
var Promise = require('promise');
var fs = require('fs');
var os = require('os');
var _ = require('underscore');
var Cache = require('../');
describe('JSTransformer Cache', () => {
var Cache;
beforeEach(() => {
require('os').tmpDir.mockImpl(() => 'tmpDir');
Cache = require('../');
os.tmpDir.mockImpl(() => 'tmpDir');
});
describe('getting/setting', () => {
@@ -19,14 +19,14 @@ jest
}
});
var FileWatcher = require('../');
var sane = require('sane');
describe('FileWatcher', function() {
var FileWatcher;
var Watcher;
beforeEach(function() {
require('mock-modules').dumpCache();
FileWatcher = require('../');
Watcher = require('sane').WatchmanWatcher;
Watcher = sane.WatchmanWatcher;
Watcher.prototype.once.mockImplementation(function(type, callback) {
callback();
});
@@ -15,12 +15,12 @@ jest
jest.mock('fs');
var Cache = require('../../Cache');
var Transformer = require('../');
var fs = require('fs');
var options;
describe('Transformer', function() {
var Transformer;
var workers;
beforeEach(function() {
@@ -33,7 +33,6 @@ describe('Transformer', function() {
transformModulePath: '/foo/bar',
cache: new Cache({}),
};
Transformer = require('../');
});
pit('should loadFileAndTransform', function() {

0 comments on commit d088750

Please sign in to comment.