-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
158 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
coverage | ||
package-lock.json | ||
node_modules | ||
build | ||
dist | ||
out | ||
*.log | ||
*.dump | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
coverage | ||
node_modules | ||
build | ||
tests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"plugins": [ | ||
"node_modules/jsdoc-babel" | ||
], | ||
"babel": { | ||
"presets": [ | ||
"env" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,41 @@ | ||
/* global describe, it, xit, before, beforeEach, after, afterEach */ | ||
/* jslint node: true, esnext: true */ | ||
|
||
'use strict'; | ||
|
||
const chai = require('chai'), | ||
assert = chai.assert, | ||
expect = chai.expect, | ||
should = chai.should(), | ||
{ | ||
ServiceProviderMixin, Service | ||
} = require('kronos-service'), | ||
{ | ||
ServiceKOA | ||
} = require('../dist/module'); | ||
import { ServiceProviderMixin, Service } from 'kronos-service'; | ||
import { ServiceKOA } from '../src/service-koa'; | ||
import test from 'ava'; | ||
|
||
class ServiceProvider extends ServiceProviderMixin(Service) {} | ||
|
||
const sp = new ServiceProvider(); | ||
|
||
describe('service-koa failures', () => { | ||
describe('with already in use port', () => { | ||
const ks1 = new ServiceKOA({ | ||
test('service-koa failures with already in use port', async t => { | ||
const ks1 = new ServiceKOA( | ||
{ | ||
name: 'my-name1', | ||
listen: { | ||
listen: { | ||
port: 1235 | ||
} | ||
}, sp); | ||
}, | ||
sp | ||
); | ||
|
||
const ks2 = new ServiceKOA({ | ||
const ks2 = new ServiceKOA( | ||
{ | ||
name: 'my-name2', | ||
listen: { | ||
listen: { | ||
port: 1235 | ||
} | ||
}, sp); | ||
|
||
it('can start', () => { | ||
ks1.start().then(() => ks2.start().then(() => { | ||
assert.equal(ks1.state, 'running'); | ||
assert.equal(ks2.state, 'running'); | ||
})); | ||
}); | ||
}); | ||
}, | ||
sp | ||
); | ||
|
||
await ks1.start(); | ||
t.is(ks1.state, 'running'); | ||
|
||
try { | ||
await ks2.start(); | ||
} catch (e) {} | ||
|
||
t.is(ks2.state, 'failed'); | ||
|
||
ks1.stop(); | ||
ks2.stop(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import multiEntry from 'rollup-plugin-multi-entry'; | ||
|
||
export default { | ||
input: 'tests/**/*-test.js', | ||
output: { | ||
file: 'build/bundle-test.js', | ||
format: 'cjs', | ||
sourcemap: true | ||
}, | ||
external: ['ava', 'model-attributes', 'kronos-service', 'kronos-endpoint'], | ||
plugins: [multiEntry()] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.