data-provider-temporary
Version:
Library that helps with server-to-client synchronization of data
52 lines (37 loc) • 1.64 kB
JavaScript
;
const getTestPathPattern = require('./getTestPathPattern'); /**
* Copyright (c) 2014-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.
*
*
*/module.exports = (argv, mode, options) => {
if (mode === 'watch') {
argv.watch = true;
argv.watchAll = false;
} else if (mode === 'watchAll') {
argv.watch = false;
argv.watchAll = true;
}
if (options.testPathPattern) {
argv.testPathPattern = options.testPathPattern;
} else if (options.testPathPattern === '') {
delete argv.testPathPattern;
delete argv._;
}
if (options.testNamePattern) {
argv.testNamePattern = options.testNamePattern;
} else if (options.testNamePattern === '') {
delete argv.testNamePattern;
}
argv.onlyChanged = false;
argv.onlyChanged =
getTestPathPattern(argv).input === '' &&
!argv.watchAll &&
!argv.testNamePattern;
if (options.noSCM) {
argv.noSCM = true;
}
};