Skip to content

Commit 22e91e8

Browse files
committed
chore: add functional tests
- fix publish test expectations - small style corrections
1 parent 6f2d6b6 commit 22e91e8

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

test/functional/auth/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @flow
22

33
import { CREDENTIALS, WRONG_CREDENTIALS } from '../config.functional';
4-
import {HTTP_STATUS} from "../../lib/constants";
4+
import { HTTP_STATUS } from "../../lib/constants";
55

66
export default (server: any, gitlab: any) => { // eslint-disable-line no-unused-vars
77

test/functional/pre-setup.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
require('babel-polyfill');
22
require('babel-register');
3-
module.exports = require('./lib/setup');
3+
const chalk = require('chalk');
4+
5+
module.exports = async () => {
6+
console.log(chalk.blue('setup: starting servers'));
7+
8+
require('./lib/setup');
9+
}
10+

test/functional/publish/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ export default (server: any, gitlab: any) => { // eslint-disable-line no-unused-
2727
.status(HTTP_STATUS.CREATED)
2828
.body_ok(/created new package/)
2929
.then((body) => {
30-
console.log(body);
30+
expect(body).toHaveProperty('ok');
31+
expect(body.ok).toMatch(/created/);
32+
expect(body).toHaveProperty('success');
33+
expect(body.success).toBe(true);
3134
});
3235
});
3336
});

test/functional/teardown.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// const chalk = require('chalk');
1+
const chalk = require('chalk');
2+
23
module.exports = async () => {
3-
// console.log(chalk.green('Teardown Verdaccio Functional'));
4-
// console.log(chalk.blue('Teardown:: all server were closed'));
4+
console.log(chalk.blue('teardown: all servers closed'));
55
};

0 commit comments

Comments
 (0)