test(before) config, plugin -> options

This commit is contained in:
coderaiser 2016-11-29 15:41:31 +02:00
parent 4d14071ede
commit ba93a87eed
5 changed files with 38 additions and 50 deletions

View file

@ -57,9 +57,11 @@ test('cloudcmd: rest: config: patch', (t) => {
});
test('cloudcmd: rest: config: patch: no configDialog', (t) => {
const configDialog = false;
const config = {
configDialog: false
};
before({configDialog}, (port, after) => {
before({config}, (port, after) => {
const json = {
ip: null
};
@ -78,9 +80,11 @@ test('cloudcmd: rest: config: patch: no configDialog', (t) => {
});
test('cloudcmd: rest: config: patch: no configDialog: statusCode', (t) => {
const configDialog = false;
const config = {
configDialog: false
};
before({configDialog}, (port, after) => {
before({config}, (port, after) => {
const json = {
ip: null
};

View file

@ -33,8 +33,9 @@ const put = promisify((options, fn) => {
});
test('cloudcmd: rest: pack: tar: get', (t) => {
const options = {packer: 'tar'};
before(options, (port, after) => {
const config = {packer: 'tar'};
before({config}, (port, after) => {
get(`http://localhost:${port}/api/v1/pack/fixture/pack`)
.then((pack) => {
const extract = tar.extract();
@ -57,8 +58,9 @@ test('cloudcmd: rest: pack: tar: get', (t) => {
});
test('cloudcmd: rest: pack: tar: put: file', (t) => {
const options = {packer: 'tar'};
before(options, (port, after) => {
const config = {packer: 'tar'};
before({config}, (port, after) => {
const name = String(Math.random()) + '.tar.gz';
const options = getPackOptions(port, name);
@ -110,8 +112,9 @@ test('cloudcmd: rest: pack: tar: put: response', (t) => {
});
test('cloudcmd: rest: pack: tar: put: error', (t) => {
const options = {packer: 'tar'};
before(options, (port, after) => {
const config = {packer: 'tar'};
before({config}, (port, after) => {
const options = getPackOptions(port, 'name', [
'not found'
]);
@ -131,8 +134,8 @@ test('cloudcmd: rest: pack: tar: put: error', (t) => {
});
test('cloudcmd: rest: pack: zip: get', (t) => {
const options = {packer: 'zip'};
before(options, (port, after) => {
const config = {packer: 'zip'};
before({config}, (port, after) => {
get(`http://localhost:${port}/api/v1/pack/fixture/pack`)
.then(_pullout)
.then((pack) => {
@ -147,8 +150,9 @@ test('cloudcmd: rest: pack: zip: get', (t) => {
});
test('cloudcmd: rest: pack: zip: put: file', (t) => {
const options = {packer: 'zip'};
before(options, (port, after) => {
const config = {packer: 'zip'};
before({config}, (port, after) => {
const name = String(Math.random()) + '.zip';
const options = getPackOptions(port, name);
@ -170,8 +174,9 @@ test('cloudcmd: rest: pack: zip: put: file', (t) => {
});
test('cloudcmd: rest: pack: zip: put: response', (t) => {
const options = {packer: 'zip'};
before(options, (port, after) => {
const config = {packer: 'zip'};
before({config}, (port, after) => {
const name = String(Math.random()) + '.zip';
const options = getPackOptions(port, name);
@ -192,8 +197,8 @@ test('cloudcmd: rest: pack: zip: put: response', (t) => {
});
test('cloudcmd: rest: pack: zip: put: error', (t) => {
const options = {packer: 'zip'};
before(options, (port, after) => {
const config = {packer: 'zip'};
before({config}, (port, after) => {
const options = getPackOptions(port, 'name', [
'not found'
]);