Skip to content

Commit 17b764c

Browse files
authored
Merge pull request #49 from bufferoverflow/chore/add-functional-tests
chore: add functional tests
2 parents 51138a9 + 22e91e8 commit 17b764c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+7616
-7
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ npm-debug.log
33
build/
44
coverage/
55
tests-report/
6+
test-storage*
7+
yarn-error.log

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ script:
88
- commitlint-travis
99
- yarn license
1010
- yarn lint
11+
- yarn code:build
1112
- yarn test:all

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,16 @@ yarn global add flow-typed
216216
flow-typed install
217217
```
218218

219+
## Functional Tests
220+
221+
In order to run functional tests with debug output, set the
222+
`VERDACCIO_DEBUG=true` environment variable,
223+
[as documented by verdaccio](https://github.com/verdaccio/verdaccio/wiki/Running-and-Debugging-tests):
224+
225+
```bash
226+
VERDACCIO_DEBUG=true yarn test:functional
227+
```
228+
219229
## Inspired by
220230

221231
- [verdaccio-ldap](https://github.com/Alexandre-io/verdaccio-ldap)

bin/verdaccio

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env node
2+
3+
process.env.NODE_PATH = __dirname + '/../..';
4+
require("module").Module._initPaths();
5+
6+
require('../build/verdaccio.js');

flow-typed/npm/body-parser_v1.x.x.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// flow-typed signature: bac0ee66e0653772d037dc47b51a5e1f
2+
// flow-typed version: da30fe6876/body-parser_v1.x.x/flow_>=v0.25.x
3+
4+
import type { Middleware, $Request, $Response } from "express";
5+
6+
declare type bodyParser$Options = {
7+
inflate?: boolean,
8+
limit?: number | string,
9+
type?: string | string[] | ((req: $Request) => any),
10+
verify?: (
11+
req: $Request,
12+
res: $Response,
13+
buf: Buffer,
14+
encoding: string
15+
) => void
16+
};
17+
18+
declare type bodyParser$OptionsText = bodyParser$Options & {
19+
reviver?: (key: string, value: any) => any,
20+
strict?: boolean
21+
};
22+
23+
declare type bodyParser$OptionsJson = bodyParser$Options & {
24+
reviver?: (key: string, value: any) => any,
25+
strict?: boolean
26+
};
27+
28+
declare type bodyParser$OptionsUrlencoded = bodyParser$Options & {
29+
extended?: boolean,
30+
parameterLimit?: number
31+
};
32+
33+
declare module "body-parser" {
34+
declare type Options = bodyParser$Options;
35+
declare type OptionsText = bodyParser$OptionsText;
36+
declare type OptionsJson = bodyParser$OptionsJson;
37+
declare type OptionsUrlencoded = bodyParser$OptionsUrlencoded;
38+
39+
declare function json(options?: OptionsJson): Middleware;
40+
41+
declare function raw(options?: Options): Middleware;
42+
43+
declare function text(options?: OptionsText): Middleware;
44+
45+
declare function urlencoded(options?: OptionsUrlencoded): Middleware;
46+
}

flow-typed/npm/chalk_v2.x.x.js

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// flow-typed signature: db5b2cdde8db39d47e27cc8ab84f89bf
2+
// flow-typed version: d662d43161/chalk_v2.x.x/flow_>=v0.25.x
3+
4+
// From: https://github.com/chalk/chalk/blob/master/index.js.flow
5+
6+
declare module "chalk" {
7+
declare type TemplateStringsArray = $ReadOnlyArray<string>;
8+
9+
declare type Level = $Values<{
10+
None: 0,
11+
Basic: 1,
12+
Ansi256: 2,
13+
TrueColor: 3
14+
}>;
15+
16+
declare type ChalkOptions = {|
17+
enabled?: boolean,
18+
level?: Level
19+
|};
20+
21+
declare type ColorSupport = {|
22+
level: Level,
23+
hasBasic: boolean,
24+
has256: boolean,
25+
has16m: boolean
26+
|};
27+
28+
declare interface Chalk {
29+
(...text: string[]): string,
30+
(text: TemplateStringsArray, ...placeholders: string[]): string,
31+
constructor(options?: ChalkOptions): Chalk,
32+
enabled: boolean,
33+
level: Level,
34+
rgb(r: number, g: number, b: number): Chalk,
35+
hsl(h: number, s: number, l: number): Chalk,
36+
hsv(h: number, s: number, v: number): Chalk,
37+
hwb(h: number, w: number, b: number): Chalk,
38+
bgHex(color: string): Chalk,
39+
bgKeyword(color: string): Chalk,
40+
bgRgb(r: number, g: number, b: number): Chalk,
41+
bgHsl(h: number, s: number, l: number): Chalk,
42+
bgHsv(h: number, s: number, v: number): Chalk,
43+
bgHwb(h: number, w: number, b: number): Chalk,
44+
hex(color: string): Chalk,
45+
keyword(color: string): Chalk,
46+
47+
+reset: Chalk,
48+
+bold: Chalk,
49+
+dim: Chalk,
50+
+italic: Chalk,
51+
+underline: Chalk,
52+
+inverse: Chalk,
53+
+hidden: Chalk,
54+
+strikethrough: Chalk,
55+
56+
+visible: Chalk,
57+
58+
+black: Chalk,
59+
+red: Chalk,
60+
+green: Chalk,
61+
+yellow: Chalk,
62+
+blue: Chalk,
63+
+magenta: Chalk,
64+
+cyan: Chalk,
65+
+white: Chalk,
66+
+gray: Chalk,
67+
+grey: Chalk,
68+
+blackBright: Chalk,
69+
+redBright: Chalk,
70+
+greenBright: Chalk,
71+
+yellowBright: Chalk,
72+
+blueBright: Chalk,
73+
+magentaBright: Chalk,
74+
+cyanBright: Chalk,
75+
+whiteBright: Chalk,
76+
77+
+bgBlack: Chalk,
78+
+bgRed: Chalk,
79+
+bgGreen: Chalk,
80+
+bgYellow: Chalk,
81+
+bgBlue: Chalk,
82+
+bgMagenta: Chalk,
83+
+bgCyan: Chalk,
84+
+bgWhite: Chalk,
85+
+bgBlackBright: Chalk,
86+
+bgRedBright: Chalk,
87+
+bgGreenBright: Chalk,
88+
+bgYellowBright: Chalk,
89+
+bgBlueBright: Chalk,
90+
+bgMagentaBright: Chalk,
91+
+bgCyanBright: Chalk,
92+
+bgWhiteBrigh: Chalk,
93+
94+
supportsColor: ColorSupport
95+
}
96+
97+
declare module.exports: Chalk;
98+
}

0 commit comments

Comments
 (0)