aztec
Version:
Node Js Framework for creating API Services
47 lines (41 loc) • 1.15 kB
JavaScript
import msvc1 from './mocks/services/service1';
import msvc2 from './mocks/services/service2';
import { request } from 'chai';
describe('Multiply services', () => {
describe('service 1', () => {
it('should work', done => {
request(msvc1.address())
.get('/api/v1/app1-route')
.end((err, res) => {
res.should.have.status(200);
done();
});
});
it('send GET to another service route and should be 404', done => {
request(msvc1.address())
.get('/api/v1/svc2-route')
.end((err, res) => {
res.should.have.status(404);
done();
});
});
});
describe('service 2', () => {
it('should work', done => {
request(msvc2.address())
.get('/api/v1/svc2-route')
.end((err, res) => {
res.should.have.status(200);
done();
});
});
it('send GET to another service route and should be 404', done => {
request(msvc2.address())
.get('/api/v1/svc1-route')
.end((err, res) => {
res.should.have.status(404);
done();
});
});
});
});