Update RN to Jest 18

Reviewed By: cpojer

Differential Revision: D4335580

fbshipit-source-id: c48b6882b89aa20f9f58783b5a17edf94df22223
This commit is contained in:
Cristian Carlesso 2016-12-19 04:30:39 -08:00 committed by Facebook Github Bot
parent 88da9e658c
commit a69b480cae
2 changed files with 20 additions and 20 deletions

View File

@ -13,10 +13,10 @@
"jest": {
"automock": true,
"transform": {
".*": "jest/preprocessor.js"
".*": "./jest/preprocessor.js"
},
"setupFiles": [
"jest/setup.js"
"./jest/setup.js"
],
"timers": "fake",
"moduleNameMapper": {
@ -152,7 +152,7 @@
"immutable": "~3.7.6",
"imurmurhash": "^0.1.4",
"inquirer": "^0.12.0",
"jest-haste-map": "17.0.3",
"jest-haste-map": "18.0.0",
"joi": "^6.6.1",
"json-stable-stringify": "^1.0.1",
"json5": "^0.4.0",
@ -199,9 +199,9 @@
"eslint-plugin-flowtype": "^2.20.0",
"eslint-plugin-react": "^6.4.1",
"flow-bin": "^0.37.0",
"jest": "17.0.3",
"jest-repl": "17.0.3",
"jest-runtime": "17.0.3",
"jest": "18.0.0",
"jest-repl": "18.0.0",
"jest-runtime": "18.0.0",
"mock-fs": "^3.11.0",
"react": "~15.4.0-rc.4",
"react-dom": "~15.4.0-rc.4",

View File

@ -25,7 +25,7 @@ const mtime = {
getTime: () => Math.ceil(Math.random() * 10000000),
};
fs.realpath.mockImpl((filepath, callback) => {
fs.realpath.mockImplementation((filepath, callback) => {
callback = asyncCallback(callback);
let node;
try {
@ -39,9 +39,9 @@ fs.realpath.mockImpl((filepath, callback) => {
callback(null, filepath);
});
fs.readdirSync.mockImpl((filepath) => Object.keys(getToNode(filepath)));
fs.readdirSync.mockImplementation((filepath) => Object.keys(getToNode(filepath)));
fs.readdir.mockImpl((filepath, callback) => {
fs.readdir.mockImplementation((filepath, callback) => {
callback = asyncCallback(callback);
let node;
try {
@ -60,7 +60,7 @@ fs.readdir.mockImpl((filepath, callback) => {
callback(null, Object.keys(node));
});
fs.readFile.mockImpl(function(filepath, encoding, callback) {
fs.readFile.mockImplementation(function(filepath, encoding, callback) {
callback = asyncCallback(callback);
if (arguments.length === 2) {
callback = encoding;
@ -84,7 +84,7 @@ fs.readFile.mockImpl(function(filepath, encoding, callback) {
}
});
fs.readFileSync.mockImpl(function(filepath, encoding) {
fs.readFileSync.mockImplementation(function(filepath, encoding) {
const node = getToNode(filepath);
// dir check
if (node && typeof node === 'object' && node.SYMLINK == null) {
@ -93,7 +93,7 @@ fs.readFileSync.mockImpl(function(filepath, encoding) {
return node;
});
fs.stat.mockImpl((filepath, callback) => {
fs.stat.mockImplementation((filepath, callback) => {
callback = asyncCallback(callback);
let node;
try {
@ -123,7 +123,7 @@ fs.stat.mockImpl((filepath, callback) => {
}
});
fs.statSync.mockImpl((filepath) => {
fs.statSync.mockImplementation((filepath) => {
const node = getToNode(filepath);
if (node.SYMLINK) {
@ -137,7 +137,7 @@ fs.statSync.mockImpl((filepath) => {
};
});
fs.lstat.mockImpl((filepath, callback) => {
fs.lstat.mockImplementation((filepath, callback) => {
callback = asyncCallback(callback);
let node;
try {
@ -162,7 +162,7 @@ fs.lstat.mockImpl((filepath, callback) => {
}
});
fs.lstatSync.mockImpl((filepath) => {
fs.lstatSync.mockImplementation((filepath) => {
const node = getToNode(filepath);
if (node.SYMLINK) {
@ -180,7 +180,7 @@ fs.lstatSync.mockImpl((filepath) => {
};
});
fs.open.mockImpl(function(filepath) {
fs.open.mockImplementation(function(filepath) {
const callback = arguments[arguments.length - 1] || noop;
let data, error, fd;
try {
@ -200,7 +200,7 @@ fs.open.mockImpl(function(filepath) {
callback(error, fd);
});
fs.read.mockImpl((fd, buffer, writeOffset, length, position, callback = noop) => {
fs.read.mockImplementation((fd, buffer, writeOffset, length, position, callback = noop) => {
let bytesWritten;
try {
if (position == null || position < 0) {
@ -215,7 +215,7 @@ fs.read.mockImpl((fd, buffer, writeOffset, length, position, callback = noop) =>
callback(null, bytesWritten, buffer);
});
fs.close.mockImpl((fd, callback = noop) => {
fs.close.mockImplementation((fd, callback = noop) => {
try {
fd.buffer = fs.position = undefined;
} catch (e) {
@ -227,7 +227,7 @@ fs.close.mockImpl((fd, callback = noop) => {
let filesystem;
fs.createReadStream.mockImpl(filepath => {
fs.createReadStream.mockImplementation(filepath => {
if (!filepath.startsWith('/')) {
throw Error('Cannot open file ' + filepath);
}
@ -254,7 +254,7 @@ fs.createReadStream.mockImpl(filepath => {
});
});
fs.createWriteStream.mockImpl(file => {
fs.createWriteStream.mockImplementation(file => {
let node;
try {
node = getToNode(dirname(file));