Improved OSS flow and lint reporting

Summary:- lint bot is now managed by Circle CI
- checked that flow and lint errors are caught both by bot and CI
- flow fix for npm 3
- Travis is now using npm 2 and Circle CI npm 3
- Refactored Travis script to be able to be able to fail on multiple lines
Closes https://github.com/facebook/react-native/pull/6508

Differential Revision: D3069500

Pulled By: davidaurelio

fb-gh-sync-id: 02772bf1eae5f2c44489c2e3a01899428a9640cb
shipit-source-id: 02772bf1eae5f2c44489c2e3a01899428a9640cb
This commit is contained in:
Konstantin Raev 2016-03-18 08:09:20 -07:00 committed by Facebook Github Bot 8
parent d533323781
commit 8a860a01c5
4 changed files with 39 additions and 23 deletions

View File

@ -1,9 +1,15 @@
/**
* Copyright (c) 2013-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'; 'use strict';
jest jest.autoMockOff();
.dontMock('node-haste/lib/lib/getPlatformExtension')
.dontMock('node-haste/node_modules/throat')
.dontMock('../');
jest jest
.mock('crypto') .mock('crypto')

View File

@ -8,15 +8,24 @@
*/ */
'use strict'; 'use strict';
jest.autoMockOff();
jest jest
.setMock('worker-farm', () => () => undefined) .setMock('worker-farm', () => () => undefined)
.dontMock('node-haste/node_modules/throat')
.dontMock('lodash')
.dontMock('../../lib/ModuleTransport')
.setMock('uglify-js') .setMock('uglify-js')
.dontMock('../'); .mock('image-size')
.mock('fs')
jest.mock('fs'); .mock('assert')
.mock('progress')
.mock('node-haste')
.mock('../../JSTransformer')
.mock('../../lib/declareOpts')
.mock('../../Resolver')
.mock('../Bundle')
.mock('../PrepackBundle')
.mock('../HMRBundle')
.mock('../../Activity')
.mock('../../lib/declareOpts');
var Bundler = require('../'); var Bundler = require('../');
var Resolver = require('../../Resolver'); var Resolver = require('../../Resolver');

View File

@ -8,22 +8,22 @@
*/ */
'use strict'; 'use strict';
jest.autoMockOff();
jest.setMock('worker-farm', function() { return () => {}; }) jest.setMock('worker-farm', function() { return () => {}; })
.dontMock('node-haste/node_modules/throat')
.dontMock('os')
.dontMock('lodash')
.dontMock('path')
.dontMock('url')
.setMock('timers', { setImmediate: (fn) => setTimeout(fn, 0) }) .setMock('timers', { setImmediate: (fn) => setTimeout(fn, 0) })
.setMock('uglify-js') .setMock('uglify-js')
.dontMock('../') .setMock('crypto')
.setMock('crypto'); .mock('../../Bundler')
.mock('../../AssetServer')
.mock('../../lib/declareOpts')
.mock('node-haste')
.mock('../../Activity');
const Promise = require('promise'); const Promise = require('promise');
var Bundler = require('../../Bundler'); var Bundler = require('../../Bundler');
var Server = require('../'); var Server = require('../');
var Server = require('../../Server');
var AssetServer = require('../../AssetServer'); var AssetServer = require('../../AssetServer');
var FileWatcher; var FileWatcher;
@ -108,7 +108,7 @@ describe('processRequest', () => {
requestHandler, requestHandler,
'mybundle.bundle?runModule=true' 'mybundle.bundle?runModule=true'
).then(response => { ).then(response => {
expect(response.getHeader('ETag')).toBeDefined() expect(response.getHeader('ETag')).toBeDefined();
}); });
}); });
@ -118,7 +118,7 @@ describe('processRequest', () => {
'mybundle.bundle?runModule=true', 'mybundle.bundle?runModule=true',
{ headers : { 'if-none-match' : 'this is an etag' } } { headers : { 'if-none-match' : 'this is an etag' } }
).then(response => { ).then(response => {
expect(response.statusCode).toEqual(304) expect(response.statusCode).toEqual(304);
}); });
}); });
@ -262,7 +262,7 @@ describe('processRequest', () => {
Bundler.prototype.bundle = bundleFunc; Bundler.prototype.bundle = bundleFunc;
const server = new Server(options); server = new Server(options);
server.setHMRFileChangeListener(() => {}); server.setHMRFileChangeListener(() => {});
requestHandler = server.processRequest.bind(server); requestHandler = server.processRequest.bind(server);

View File

@ -8,11 +8,12 @@
*/ */
'use strict'; 'use strict';
jest.autoMockOff();
jest.setMock('uglify-js') jest.setMock('uglify-js')
.mock('net') .mock('net')
.mock('fs') .mock('fs')
.dontMock('node-haste/node_modules/throat') .mock('bser')
.dontMock('../SocketServer'); .mock('../../Server');
var PackagerServer = require('../../Server'); var PackagerServer = require('../../Server');
var SocketServer = require('../SocketServer'); var SocketServer = require('../SocketServer');