Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 d088750
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Expand Up @@ -68,7 +68,7 @@ describe('Activity', () => {

expect(() => {
Activity.endEvent(eid);
}).toThrow('event(3) has already ended!');
}).toThrow('event(1) has already ended!');
});
});

Expand All @@ -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));
});
Expand Down
7 changes: 4 additions & 3 deletions packager/react-packager/src/Cache/__tests__/Cache-test.js
Expand Up @@ -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', () => {
Expand Down
Expand Up @@ -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();
});
Expand Down
Expand Up @@ -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() {
Expand All @@ -33,7 +33,6 @@ describe('Transformer', function() {
transformModulePath: '/foo/bar',
cache: new Cache({}),
};
Transformer = require('../');
});

pit('should loadFileAndTransform', function() {
Expand Down

0 comments on commit d088750

Please sign in to comment.