Skip to content

Commit

Permalink
chore(filenames): fix intergration-tests subfolders
Browse files Browse the repository at this point in the history
Fixes all the folder names in the integration-tests folder to follow Facebook internal file / folder
naming conventions. This is the first of several incremental PRs.
  • Loading branch information
jamischarles committed Jan 13, 2018
1 parent 3f15450 commit 5501be2
Show file tree
Hide file tree
Showing 123 changed files with 87 additions and 81 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
the case of `--lastCommit`, `--findRelatedTests`, or `--onlyChanged` options
having been passed to the CLI

### Chore & Maintenance

* `[filenames]` Standardize folder names under `integration-tests/`
([#5298](https://github.com/facebook/jest/pull/5298))


## jest 22.0.6

### Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ exports[`outputs coverage report 1`] = `
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
-------------------------------------|----------|----------|----------|----------|----------------|
All files | 56.52 | 0 | 50 | 56.52 | |
coverage_report | 41.18 | 0 | 25 | 41.18 | |
coverage-report | 41.18 | 0 | 25 | 41.18 | |
not-required-in-test-suite.js | 0 | 0 | 0 | 0 | 8,15,16,17,19 |
other-file.js | 100 | 100 | 100 | 100 | |
sum.js | 85.71 | 100 | 50 | 85.71 | 12 |
sum_dependency.js | 0 | 0 | 0 | 0 | 8,10,11,14 |
coverage_report/cached-duplicates/a | 100 | 100 | 100 | 100 | |
coverage-report/cached-duplicates/a | 100 | 100 | 100 | 100 | |
identical.js | 100 | 100 | 100 | 100 | |
coverage_report/cached-duplicates/b | 100 | 100 | 100 | 100 | |
coverage-report/cached-duplicates/b | 100 | 100 | 100 | 100 | |
identical.js | 100 | 100 | 100 | 100 | |
-------------------------------------|----------|----------|----------|----------|----------------|
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

exports[`--listTests flag causes tests to be printed in different lines 1`] = `
"
/MOCK_ABOLUTE_PATH/integration-tests/list_tests/__tests__/dummy.test.js
/MOCK_ABOLUTE_PATH/integration-tests/list_tests/__tests__/other.test.js"
/MOCK_ABOLUTE_PATH/integration-tests/list-tests/__tests__/dummy.test.js
/MOCK_ABOLUTE_PATH/integration-tests/list-tests/__tests__/other.test.js"
`;

exports[`--listTests flag causes tests to be printed out as JSON when using the --json flag 1`] = `"[\\"/MOCK_ABOLUTE_PATH/integration-tests/list_tests/__tests__/dummy.test.js\\",\\"/MOCK_ABOLUTE_PATH/integration-tests/list_tests/__tests__/other.test.js\\"]"`;
exports[`--listTests flag causes tests to be printed out as JSON when using the --json flag 1`] = `"[\\"/MOCK_ABOLUTE_PATH/integration-tests/list-tests/__tests__/dummy.test.js\\",\\"/MOCK_ABOLUTE_PATH/integration-tests/list-tests/__tests__/other.test.js\\"]"`;
6 changes: 3 additions & 3 deletions integration-tests/__tests__/clear_cache.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ const os = require('os');
const path = require('path');
const runJest = require('../runJest');

const CACHE = path.resolve(os.tmpdir(), 'clear_cache_directory');
const CACHE = path.resolve(os.tmpdir(), 'clear-cache_directory');

describe('jest --clearCache', () => {
test('normal run results in cache directory being written', () => {
const {status} = runJest('clear_cache', [`--cacheDirectory=${CACHE}`]);
const {status} = runJest('clear-cache', [`--cacheDirectory=${CACHE}`]);

expect(fs.existsSync(CACHE)).toBe(true);
expect(status).toBe(0);
});
test('clearCache results in deleted directory and exit status 0', () => {
expect(fs.existsSync(CACHE)).toBe(true);

const {status, stdout, stderr} = runJest('clear_cache', [
const {status, stdout, stderr} = runJest('clear-cache', [
'--clearCache',
`--cacheDirectory=${CACHE}`,
]);
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/__tests__/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const runJest = require('../runJest');

test('config as JSON', () => {
const result = runJest('verbose_reporter', [
const result = runJest('verbose-reporter', [
'--config=' +
JSON.stringify({
testEnvironment: 'node',
Expand All @@ -25,7 +25,7 @@ test('config as JSON', () => {
});

test('works with sane config JSON', () => {
const result = runJest('verbose_reporter', [
const result = runJest('verbose-reporter', [
'--config=' +
JSON.stringify({
testEnvironment: 'node',
Expand All @@ -38,7 +38,7 @@ test('works with sane config JSON', () => {
});

test('watchman config option is respected over default argv', () => {
const {stdout} = runJest('verbose_reporter', [
const {stdout} = runJest('verbose-reporter', [
'--env=node',
'--watchman=false',
'--debug',
Expand All @@ -48,7 +48,7 @@ test('watchman config option is respected over default argv', () => {
});

test('config from argv is respected with sane config JSON', () => {
const {stdout} = runJest('verbose_reporter', [
const {stdout} = runJest('verbose-reporter', [
'--config=' +
JSON.stringify({
testEnvironment: 'node',
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/__tests__/coverage_report.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ const skipOnWindows = require('../../scripts/skip_on_windows');
const {extractSummary} = require('../utils');
const runJest = require('../runJest');

const DIR = path.resolve(__dirname, '../coverage_report');
const DIR = path.resolve(__dirname, '../coverage-report');

skipOnWindows.suite();

test('outputs coverage report', () => {
const {stdout, status} = runJest(DIR, ['--no-cache', '--coverage']);
const coverageDir = path.resolve(__dirname, '../coverage_report/coverage');
const coverageDir = path.resolve(__dirname, '../coverage-report/coverage');

// - the `setup.js` file is ignored and should not be in the coverage report.
// - `sum_dependency.js` is mocked and the real module is never required but
Expand Down Expand Up @@ -60,7 +60,7 @@ test('collects coverage only from specified files avoiding dependencies', () =>
});

test('json reporter printing with --coverage', () => {
const {stderr, status} = runJest('json_reporter', ['--coverage']);
const {stderr, status} = runJest('json-reporter', ['--coverage']);
const {summary} = extractSummary(stderr);
expect(status).toBe(1);
expect(summary).toMatchSnapshot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const skipOnWindows = require('../../scripts/skip_on_windows');
skipOnWindows.suite();

test('works with custom matchers', () => {
const {stderr} = runJest('custom_matcher_stack_trace');
const {stderr} = runJest('custom-matcher-stack-trace');

let {rest} = extractSummary(stderr);

Expand Down
16 changes: 8 additions & 8 deletions integration-tests/__tests__/custom_reporters.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const runJest = require('../runJest');
const os = require('os');
const path = require('path');

const DIR = path.resolve(os.tmpdir(), 'custom_reporters_test_dir');
const DIR = path.resolve(os.tmpdir(), 'custom-reporters_test_dir');

beforeEach(() => cleanup(DIR));
afterEach(() => cleanup(DIR));
Expand All @@ -27,7 +27,7 @@ describe('Custom Reporters Integration', () => {
reporters: ['<rootDir>/reporters/test_reporter.js'],
};

const {status} = runJest('custom_reporters', [
const {status} = runJest('custom-reporters', [
'--config',
JSON.stringify(reporterConfig),
'add.test.js',
Expand All @@ -46,7 +46,7 @@ describe('Custom Reporters Integration', () => {
],
};

const {status, stdout} = runJest('custom_reporters', [
const {status, stdout} = runJest('custom-reporters', [
'--config',
JSON.stringify(reporterConfig),
'add.test.js',
Expand All @@ -61,7 +61,7 @@ describe('Custom Reporters Integration', () => {
reporters: [[3243242]],
};

const {status, stderr} = runJest('custom_reporters', [
const {status, stderr} = runJest('custom-reporters', [
'--config',
JSON.stringify(reporterConfig),
'add.test.js',
Expand All @@ -72,7 +72,7 @@ describe('Custom Reporters Integration', () => {
});

test('default reporters enabled', () => {
const {stderr, stdout, status} = runJest('custom_reporters', [
const {stderr, stdout, status} = runJest('custom-reporters', [
'--config',
JSON.stringify({
reporters: ['default', '<rootDir>/reporters/test_reporter.js'],
Expand All @@ -90,7 +90,7 @@ describe('Custom Reporters Integration', () => {
});

test('TestReporter with all tests passing', () => {
const {stdout, status, stderr} = runJest('custom_reporters', [
const {stdout, status, stderr} = runJest('custom-reporters', [
'add.test.js',
]);

Expand All @@ -102,7 +102,7 @@ describe('Custom Reporters Integration', () => {
});

test('TestReporter with all tests failing', () => {
const {stdout, status, stderr} = runJest('custom_reporters', [
const {stdout, status, stderr} = runJest('custom-reporters', [
'add_fail.test.js',
]);

Expand All @@ -114,7 +114,7 @@ describe('Custom Reporters Integration', () => {
});

test('IncompleteReporter for flexibility', () => {
const {stderr, stdout, status} = runJest('custom_reporters', [
const {stderr, stdout, status} = runJest('custom-reporters', [
'--no-cache',
'--config',
JSON.stringify({
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/__tests__/debug.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const runJest = require('../runJest');
describe('jest --debug', () => {
skipOnWindows.suite();

const dir = path.resolve(__dirname, '..', 'verbose_reporter');
const dir = path.resolve(__dirname, '..', 'verbose-reporter');

it('outputs debugging info before running the test', () => {
const {stdout} = runJest(dir, ['--debug', '--no-cache']);
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/__tests__/empty_suite_error.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const path = require('path');
const runJest = require('../runJest');

const DIR = path.resolve(__dirname, '../empty_suite_error');
const DIR = path.resolve(__dirname, '../empty-suite-error');

describe('JSON Reporter', () => {
it('fails the test suite if it contains no tests', () => {
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/__tests__/global_setup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ const path = require('path');
const runJest = require('../runJest');
const {cleanup} = require('../utils');

const DIR = path.join(os.tmpdir(), 'jest_global_setup');
const DIR = path.join(os.tmpdir(), 'jest-global-setup');

beforeEach(() => cleanup(DIR));
afterAll(() => cleanup(DIR));

test('globalSetup is triggered once before all test suites', () => {
const setupPath = path.resolve(__dirname, '../global_setup/setup.js');
const result = runJest.json('global_setup', [`--globalSetup=${setupPath}`]);
const setupPath = path.resolve(__dirname, '../global-setup/setup.js');
const result = runJest.json('global-setup', [`--globalSetup=${setupPath}`]);
expect(result.status).toBe(0);
const files = fs.readdirSync(DIR);
expect(files).toHaveLength(1);
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/__tests__/global_teardown.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const path = require('path');
const runJest = require('../runJest');
const {cleanup} = require('../utils');

const DIR = path.join(os.tmpdir(), 'jest_global_teardown');
const DIR = path.join(os.tmpdir(), 'jest-global-teardown');

beforeEach(() => cleanup(DIR));
afterAll(() => cleanup(DIR));
Expand All @@ -23,9 +23,9 @@ test('globalTeardown is triggered once after all test suites', () => {
mkdirp.sync(DIR);
const teardownPath = path.resolve(
__dirname,
'../global_teardown/teardown.js',
'../global-teardown/teardown.js',
);
const result = runJest.json('global_teardown', [
const result = runJest.json('global-teardown', [
`--globalTeardown=${teardownPath}`,
]);
expect(result.status).toBe(0);
Expand Down
22 changes: 11 additions & 11 deletions integration-tests/__tests__/jasmine_async.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const runJest = require('../runJest');

describe('async jasmine', () => {
it('works with beforeAll', () => {
const result = runJest.json('jasmine_async', [
const result = runJest.json('jasmine-async', [
'promise_before_all.test.js',
]);
const json = result.json;
Expand All @@ -31,7 +31,7 @@ describe('async jasmine', () => {
});

it('works with beforeEach', () => {
const result = runJest.json('jasmine_async', [
const result = runJest.json('jasmine-async', [
'promise_before_each.test.js',
]);
const json = result.json;
Expand All @@ -47,7 +47,7 @@ describe('async jasmine', () => {
});

it('works with afterAll', () => {
const result = runJest.json('jasmine_async', ['promise_after_all.test.js']);
const result = runJest.json('jasmine-async', ['promise_after_all.test.js']);
const json = result.json;

expect(json.numTotalTests).toBe(2);
Expand All @@ -60,7 +60,7 @@ describe('async jasmine', () => {
});

it('works with afterEach', () => {
const result = runJest.json('jasmine_async', [
const result = runJest.json('jasmine-async', [
'promise_after_each.test.js',
]);
const json = result.json;
Expand All @@ -73,7 +73,7 @@ describe('async jasmine', () => {
});

it('works with fit', () => {
const result = runJest.json('jasmine_async', ['promise_fit.test.js']);
const result = runJest.json('jasmine-async', ['promise_fit.test.js']);
const json = result.json;

expect(json.numTotalTests).toBe(3);
Expand All @@ -84,7 +84,7 @@ describe('async jasmine', () => {
});

it('works with xit', () => {
const result = runJest.json('jasmine_async', ['promise_xit.test.js']);
const result = runJest.json('jasmine-async', ['promise_xit.test.js']);
const json = result.json;

expect(json.numTotalTests).toBe(2);
Expand All @@ -94,7 +94,7 @@ describe('async jasmine', () => {
});

it('throws when not a promise is returned', () => {
const result = runJest.json('jasmine_async', ['returning_values.test.js']);
const result = runJest.json('jasmine-async', ['returning_values.test.js']);
const json = result.json;

expect(json.numTotalTests).toBe(11);
Expand All @@ -104,7 +104,7 @@ describe('async jasmine', () => {
});

it('tests async promise code', () => {
const result = runJest.json('jasmine_async', ['promise_it.test.js']);
const result = runJest.json('jasmine-async', ['promise_it.test.js']);
const json = result.json;
const message = json.testResults[0].message;

Expand All @@ -124,7 +124,7 @@ describe('async jasmine', () => {
});

it('works with concurrent', () => {
const result = runJest.json('jasmine_async', ['concurrent.test.js']);
const result = runJest.json('jasmine-async', ['concurrent.test.js']);
const json = result.json;
expect(json.numTotalTests).toBe(4);
expect(json.numPassedTests).toBe(2);
Expand All @@ -134,7 +134,7 @@ describe('async jasmine', () => {
});

it('async test fails', () => {
const result = runJest.json('jasmine_async', ['async_test_fails.test.js']);
const result = runJest.json('jasmine-async', ['async_test_fails.test.js']);

expect(result.status).toBe(1);
expect(result.json.testResults[0].message).toEqual(
Expand All @@ -143,7 +143,7 @@ describe('async jasmine', () => {
});

it('generator test', () => {
const result = runJest('jasmine_async', ['generator.test.js']);
const result = runJest('jasmine-async', ['generator.test.js']);

expect(result.status).toBe(0);
});
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/__tests__/json_reporter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('JSON Reporter', () => {
const outputFileName = 'sum.result.json';
const outputFilePath = path.join(
process.cwd(),
'integration-tests/json_reporter/',
'integration-tests/json-reporter/',
outputFileName,
);

Expand All @@ -27,7 +27,7 @@ describe('JSON Reporter', () => {
it('writes test result to sum.result.json', () => {
let jsonResult;

runJest('json_reporter', ['--json', `--outputFile=${outputFileName}`]);
runJest('json-reporter', ['--json', `--outputFile=${outputFileName}`]);
const testOutput = fs.readFileSync(outputFilePath, 'utf8');

try {
Expand Down Expand Up @@ -65,7 +65,7 @@ describe('JSON Reporter', () => {
});

it('outputs coverage report', () => {
const result = runJest('json_reporter', ['--json']);
const result = runJest('json-reporter', ['--json']);
const stdout = result.stdout.toString();
const stderr = result.stderr.toString();
let jsonResult;
Expand Down
Loading

0 comments on commit 5501be2

Please sign in to comment.