Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AppVeyor configuration #1465

Merged
merged 3 commits into from
Sep 3, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
environment:
matrix:
- nodejs_version: "4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's just not support node 4 on windows. I don't think we'll be able to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any issues with Node 4 that would cause it to break?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No but I'm deciding right now that the only node version we support on Windows will be the latest.

- nodejs_version: "6"

install:
- ps: Install-Product node $env:nodejs_version x64
- npm i -g npm@latest
- node --version
- npm --version
- npm install

test_script:
- npm run build
# Hax - Some snapshot tests don't currently work on Windows, so the tests are
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe remove this Hax :P

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need the hack for now, otherwise the build fails :( I'll remove it at
some point.

Sent from my phone.

On Sep 2, 2016 12:50 PM, "Christoph Pojer" [email protected] wrote:

In appveyor.yml
#1465 (comment):

@@ -0,0 +1,22 @@
+environment:

  • matrix:
    • nodejs_version: "4"
    • nodejs_version: "6"

+install:

    • ps: Install-Product node $env:nodejs_version x64
    • npm i -g npm@latest
    • node --version
    • npm --version
    • npm install

+test_script:

    • npm run build
  • Hax - Some snapshot tests don't currently work on Windows, so the tests are

Maybe remove this Hax :P


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/facebook/jest/pull/1465/files/a83dddfad34dbc11385a6e1606ef3ff4b84c980e#r77402861,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFnHfNi2eFOaFwXervZLrsQXxJ5I_Rkks5qmH4VgaJpZM4JoL_3
.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No no, sorry I mean the word "Hax". :D

# commented out. Jest complains that obsolete snapshot files exist, so the
# "-u" will just delete those snapshots when running in the AppVeyor run,
# instead of failing the build.
- npm run jest -- -u --color

# Don't actually build.
build: off
15 changes: 10 additions & 5 deletions integration_tests/__tests__/babel-plugin-jest-hoist-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@
const {linkJestPackage, run} = require('../utils');
const path = require('path');
const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

const DIR = path.resolve(__dirname, '..', 'babel-plugin-jest-hoist');

beforeEach(() => {
run('npm i', DIR);
linkJestPackage('babel-plugin-jest-hoist', DIR);
linkJestPackage('babel-jest', DIR);
});
skipOnWindows.suite();

if (process.platform !== 'win32') {
beforeEach(() => {
run('npm i', DIR);
linkJestPackage('babel-plugin-jest-hoist', DIR);
linkJestPackage('babel-jest', DIR);
});
}

it('sucessfully runs the tests inside `babel-plugin-jest-hoist/`', () => {
const {json} = runJest.json(DIR, ['--no-cache']);
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/__tests__/config-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
'use strict';

const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

skipOnWindows.suite();

test('config as JSON', () => {
const result = runJest('verbose_reporter', [
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/__tests__/console-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
'use strict';

const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

skipOnWindows.suite();

test('console printing', () => {
const result = runJest('console');
Expand Down
7 changes: 6 additions & 1 deletion integration_tests/__tests__/coverage_report-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ const {linkJestPackage} = require('../utils');
const runJest = require('../runJest');
const fs = require('fs');
const path = require('path');
const skipOnWindows = require('jest-util/build/skipOnWindows');

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

beforeEach(() => linkJestPackage('babel-jest', DIR));
if (process.platform !== 'win32') {
beforeEach(() => linkJestPackage('babel-jest', DIR));
}

skipOnWindows.suite();

test('outputs coverage report', () => {
const {stdout, status} = runJest(DIR, ['--no-cache', '--coverage']);
Expand Down
7 changes: 6 additions & 1 deletion integration_tests/__tests__/debug-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@
const {linkJestPackage} = require('../utils');
const path = require('path');
const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

describe('jest --debug', () => {
skipOnWindows.suite();

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

beforeEach(() => {
linkJestPackage('babel-jest', dir);
if (process.platform !== 'win32') {
linkJestPackage('babel-jest', dir);
}
});

it('outputs debugging info before running the test', () => {
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/__tests__/empty_suite_error-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@

const path = require('path');
const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

const DIR = path.resolve(__dirname, '../empty_suite_error');

describe('JSON Reporter', () => {
skipOnWindows.suite();

it('fails the test suite if it contains no tests', () => {
const result = runJest(DIR, []);
const stderr = result.stderr.toString();
Expand Down
2 changes: 2 additions & 0 deletions integration_tests/__tests__/env-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
'use strict';

const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

const getLog = result => result.stdout.toString().split('\n')[1].trim();

describe('Environment override', () => {
skipOnWindows.suite();

it('uses jsdom when specified', () => {
const result = runJest('env-test', ['--env=jsdom']);
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/__tests__/failures-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@

const path = require('path');
const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

const dir = path.resolve(__dirname, '../failures');

skipOnWindows.suite();

test('throwing not Error objects', () => {
let stderr;
stderr = runJest(dir, ['throw-number-test.js']).stderr;
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/__tests__/jasmine_async-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
'use strict';

const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

describe('async jasmine', () => {
skipOnWindows.suite();

it('works with beforeAll', () => {
const result = runJest.json(
'jasmine_async',
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/__tests__/json_reporter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
'use strict';

const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

describe('JSON Reporter', () => {
skipOnWindows.suite();

it('outputs coverage report', () => {
const result = runJest('json_reporter', ['--json']);
const stdout = result.stdout.toString();
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/__tests__/no-test-found-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
'use strict';

const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

describe('Coverage Report', () => {
skipOnWindows.suite();

it('outputs coverage report', () => {
const result = runJest('coverage_report', ['not-a-valid-test']);
const stdout = result.stdout.toString();
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/__tests__/regex-(char-in-path-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
'use strict';

const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

describe('Regex Char In Path', () => {
skipOnWindows.suite();

it('parses paths containing regex chars correctly', () => {
const {json} = runJest.json('regex-(char-in-path', []);

Expand Down
3 changes: 3 additions & 0 deletions integration_tests/__tests__/set-immediate-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
'use strict';

const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

skipOnWindows.suite();

test('setImmediate', () => {
const result = runJest('set_immediate', ['--verbose']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
'use strict';

const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

describe('--setupTestFrameworkScriptFile setup.js', () => {
skipOnWindows.suite();

it('requires a setup file before each file in the suite', () => {
const result = runJest.json('setup_test_framework_script_file_cli_config', [
'--setupTestFrameworkScriptFile',
Expand Down
2 changes: 2 additions & 0 deletions integration_tests/__tests__/snapshot-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
const fs = require('fs');
const path = require('path');
const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

const emptyTest = 'describe("", () => {it("", () => {})})';
const snapshotDir =
Expand Down Expand Up @@ -54,6 +55,7 @@ const getSnapshotOfCopy = () => {
};

describe('Snapshot', () => {
skipOnWindows.suite();

const cleanup = () => {
[
Expand Down
2 changes: 2 additions & 0 deletions integration_tests/__tests__/stack_trace-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
'use strict';

const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

describe('Stack Trace', () => {
skipOnWindows.suite();

it('prints a stack trace for runtime errors', () => {
const result = runJest('stack_trace', ['runtime-error-test.js']);
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/__tests__/testcheck-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
'use strict';

const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

describe('testcheck', () => {
skipOnWindows.suite();

it('works', () => {
const result = runJest.json('testcheck', ['testcheck-test.js']);
const json = result.json;
Expand Down
8 changes: 6 additions & 2 deletions integration_tests/__tests__/transform-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@
const {linkJestPackage, run} = require('../utils');
const path = require('path');
const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

describe('babel-jest', () => {
skipOnWindows.suite();
const dir = path.resolve(__dirname, '..', 'transform/babel-jest');

beforeEach(() => {
run('npm install', dir);
linkJestPackage('babel-jest', dir);
if (process.platform !== 'win32') {
run('npm install', dir);
linkJestPackage('babel-jest', dir);
}
});

it('runs transpiled code', () => {
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/__tests__/typescript-coverage-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
const {run} = require('../utils');
const path = require('path');
const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

skipOnWindows.suite();

it('instruments and collects coverage for typescript files', () => {
const dir = path.resolve(__dirname, '../typescript-coverage');
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/__tests__/verbose-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
'use strict';

const runJest = require('../runJest');
const skipOnWindows = require('jest-util/build/skipOnWindows');

skipOnWindows.suite();

test('Verbose Reporter', () => {
const result = runJest('verbose_reporter');
Expand Down
4 changes: 4 additions & 0 deletions packages/jest-changed-files/src/__tests__/git-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ describe('git', () => {
childProcess.spawnSync('git', ['init', tmpdir]);

return git.isGitRepository(tmpdir).then(res => {
if (process.platform === 'win32') {
// Git port on Win32 returns paths with "/" rather than "\"
res = res.replace(/\//g, '\\');
}
expect(res).toContain(tmpdir);
});
});
Expand Down
3 changes: 3 additions & 0 deletions packages/jest-cli/src/__tests__/SearchSource-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000;

const path = require('path');
const skipOnWindows = require('jest-util/build/skipOnWindows');

const rootDir = path.resolve(__dirname, 'test_root');
const testRegex = path.sep + '__testtests__' + path.sep;
Expand All @@ -21,6 +22,8 @@ let findMatchingTests;
let normalizeConfig;

describe('SearchSource', () => {
skipOnWindows.suite();

const name = 'SearchSource';
let Runtime;
let SearchSource;
Expand Down
3 changes: 3 additions & 0 deletions packages/jest-haste-map/src/__tests__/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*/
'use strict';

const skipOnWindows = require('jest-util/build/skipOnWindows');

jest.mock('child_process', () => ({
// If this does not throw, we'll use the (mocked) watchman crawler
execSync() {},
Expand Down Expand Up @@ -59,6 +61,7 @@ let workerFarmMock;
let writeFileSync;

describe('HasteMap', () => {
skipOnWindows.suite();

beforeEach(() => {
jest.resetModules();
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-haste-map/src/__tests__/worker-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'use strict';

const H = require('../constants');
const skipOnWindows = require('jest-util/build/skipOnWindows');
const worker = require('../worker');

const fs = require('graceful-fs');
Expand All @@ -21,6 +22,7 @@ let readFileSync;
let workerError;

describe('worker', () => {
skipOnWindows.suite();

beforeEach(() => {
mockFs = {
Expand Down
3 changes: 3 additions & 0 deletions packages/jest-haste-map/src/crawlers/__tests__/node-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*/
'use strict';

const skipOnWindows = require('jest-util/build/skipOnWindows');

jest.mock('child_process', () => ({
spawn: jest.fn((cmd, args) => {
let closeCallback;
Expand Down Expand Up @@ -67,6 +69,7 @@ let nodeCrawl;
let childProcess;

describe('node crawler', () => {
skipOnWindows.suite();

beforeEach(() => {
jest.resetModules();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*/
'use strict';

const skipOnWindows = require('jest-util/build/skipOnWindows');

jest.mock('fb-watchman', () => {
const Client = jest.fn();
Client.prototype.command = jest.fn((args, callback) => {
Expand All @@ -30,6 +32,7 @@ let mockResponse;
let mockFiles;

describe('watchman watch', () => {
skipOnWindows.suite();

beforeEach(() => {
watchmanCrawl = require('../watchman');
Expand Down
Loading