Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Commit

Permalink
Undo some overzealous auto formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ascjones committed Jun 7, 2018
1 parent 86768f2 commit f78ec84
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions test/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ const app = require('../server');
const secret = 'test';
const gasPrice = '0x4f9aca000';

const server = new ServerMock({
host: 'localhost',
port: 8545
});
const server = new ServerMock({ host: 'localhost', port: 8545 });

describe('push-release', () => {
async function pushRelease(commit, network, forkBlock, critical) {
Expand All @@ -33,9 +30,7 @@ describe('push-release', () => {
let res = await request(app => app
.post(`/push-release/v1.7.13/${commit}`)
.type('form')
.send({
secret
})
.send({ secret })
);

const expectedCritical = critical ? '1' : '0';
Expand All @@ -56,9 +51,7 @@ describe('push-release', () => {
let res = await request(app => app
.post('/push-release/v1.9.5/e92e6c4f796f6338b2a99c499a0fe9c238f2d84f')
.type('form')
.send({
secret: 'xxx'
})
.send({ secret: 'xxx' })
);

expect(res).to.have.status(401);
Expand All @@ -70,9 +63,7 @@ describe('push-release', () => {
let res = await request(app => app
.post(`/push-release/${tag}/e92e6c4f796f6338b2a99c499a0fe9c238f2d84f`)
.type('form')
.send({
secret
})
.send({ secret })
);

expect(res).to.have.status(202);
Expand All @@ -87,9 +78,7 @@ describe('push-release', () => {
let res = await request(app => app
.post('/push-release/v1.7.13/8b749367')
.type('form')
.send({
secret
})
.send({ secret })
);

expect(res).to.have.status(400);
Expand Down Expand Up @@ -195,9 +184,7 @@ describe('push-build', () => {
path: '/',
reply: {
status: 200,
headers: {
'content-type': 'application/json'
},
headers: { 'content-type': 'application/json' },
body: parityRespond(requests)
}
});
Expand Down Expand Up @@ -234,7 +221,7 @@ describe('push-build', () => {
});

// Overcoming a bug in chai-http: https://github.com/chaijs/chai-http/issues/156
function request(fn) {
function request (fn) {
return new Promise((resolve, reject) => {
return fn(chai.request(app)).end((err, res) => {
if (res) {
Expand All @@ -246,14 +233,12 @@ function request(fn) {
});
}

function parityRespond(requests, chain) {
function parityRespond (requests, chain) {
return (req) => {
requests.push(req.body);

let result = null;
const {
method
} = req.body;
const { method } = req.body;

if (method === 'parity_chain') {
result = (chain === undefined) ? 'kovan' : chain;
Expand Down

0 comments on commit f78ec84

Please sign in to comment.