Skip to content

Commit

Permalink
Pkg-tests testsuite (#5392)
Browse files Browse the repository at this point in the history
* Adds the pkg-tests testsuite to the repository

* Fixes flow

* Adds babel to strip flowtypes

* Moves pkg-tests into the packages directory

* Fixes server timeouts

* Feedback
  • Loading branch information
arcanis authored Feb 27, 2018
1 parent dd1bf7c commit 5fc6f7f
Show file tree
Hide file tree
Showing 96 changed files with 5,358 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[ignore]
<PROJECT_ROOT>/packages/pkg-tests/.*
<PROJECT_ROOT>/coverage/.*
<PROJECT_ROOT>/dist/.*
<PROJECT_ROOT>/lib-legacy/.*
Expand All @@ -17,8 +18,7 @@ untyped-type-import=warn

[options]
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
unsafe.enable_getters_and_setters=true
include_warnings=true

[version]
^0.52.0
^0.66.0
2 changes: 2 additions & 0 deletions __tests__/commands/_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const path = require('path');

const installFixturesLoc = path.join(__dirname, '..', 'fixtures', 'install');

// $FlowFixMe I don't understand the error
export const runInstall = run.bind(
null,
ConsoleReporter,
Expand All @@ -33,6 +34,7 @@ export const runInstall = run.bind(

const linkFixturesLoc = path.join(__dirname, '..', 'fixtures', 'link');

// $FlowFixMe I don't understand the error
export const runLink = run.bind(
null,
ConsoleReporter,
Expand Down
2 changes: 1 addition & 1 deletion __tests__/commands/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ test.skip('add asks for correct package version if user passes an incorrect one'
expect(await getPackageVersion(config, 'is-array')).toEqual(chosenVersion);
},
() => {
// $FlowFixMe It seems we're assigning something totally different from what inquirer expects :/
inquirer.prompt = jest.fn(questions => {
expect(questions).toHaveLength(1);
expect(questions[0].name).toEqual('package');
Expand All @@ -849,7 +850,6 @@ test.skip('add asks for correct package version if user passes an incorrect one'
invariant(choices.length > 0);
chosenVersion = choices[0];
invariant(typeof chosenVersion === 'string');
// $FlowFixMe: No sane way to return an "extended" Promise object
return Promise.resolve({package: chosenVersion});
});
},
Expand Down
11 changes: 7 additions & 4 deletions flow-typed/npm/debug_v2.x.x.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
declare module 'debug' {
// flow-typed signature: c7b1e1d8d9c2230d131299ddc21dcb0e
// flow-typed version: da30fe6876/debug_v2.x.x/flow_>=v0.28.x

declare module "debug" {
declare type Debugger = {
(...args: Array<mixed>): void,
(formatter: string, ...args: Array<mixed>): void,
(err: Error, ...args: Array<mixed>): void,
enabled: boolean,
log: () => {},
namespace: string;
namespace: string
};

declare function exports(namespace: string): Debugger;
declare module.exports: (namespace: string) => Debugger;

declare var names: Array<string>;
declare var skips: Array<string>;
Expand All @@ -24,4 +27,4 @@ declare module 'debug' {
declare var formatters: {
[formatter: string]: () => {}
};
};
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"eslint-plugin-relay": "^0.0.8",
"eslint-plugin-yarn-internal": "file:scripts/eslint-rules",
"execa": "^0.9.0",
"flow-bin": "^0.52.0",
"flow-bin": "^0.66.0",
"gulp": "^3.9.0",
"gulp-babel": "^7.0.0",
"gulp-if": "^2.0.1",
Expand Down Expand Up @@ -128,7 +128,8 @@
"testPathIgnorePatterns": [
"__tests__/(fixtures|__mocks__)/",
"updates/",
"/_(temp|mock|install|init|helpers).js$"
"/_(temp|mock|install|init|helpers).js$",
"/packages/pkg-tests"
]
},
"config": {
Expand Down
3 changes: 3 additions & 0 deletions packages/pkg-tests/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["flow", "env"]
}
2 changes: 2 additions & 0 deletions packages/pkg-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
yarn-error.log
Loading

0 comments on commit 5fc6f7f

Please sign in to comment.