Skip to content

Commit

Permalink
fix: service exports
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-lemon committed Aug 9, 2019
1 parent a033bda commit 33a5b3e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
"author": "Steve Jung <[email protected]> (https://lemoncloud.io)",
"license": "MIT",
"files": [
"index.js",
"handler.js",
"dist/**/*"
],
Expand Down
8 changes: 4 additions & 4 deletions src/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ import hello from './api/hello-api';
import * as $kms from './service/kms-service';
import * as $s3s from './service/s3s-service';
import * as $sns from './service/sns-service';
export { $kms, $s3s, $sns };
// export { $kms, $s3s, $sns };

//! Load Additional Handlers......
import $SNS from './builder/SNS';
import { $SQS } from 'lemon-core';

//! build additional handlers.....
export const SNS = $SNS('hello');
export const SQS = $SQS('hello');
const SNS = $SNS('hello');
const SQS = $SQS('hello');

//! export default.
export default Object.assign($engine, { hello, SNS, SQS });
export default Object.assign($engine, { hello, SNS, SQS, $kms, $s3s, $sns });
10 changes: 5 additions & 5 deletions test/test.hello-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
import request from 'supertest';
import { app } from '../src/express';
import { $kms, $s3s, $sns } from '../src/engine';
import $engine from '../src/engine';

// Test Hello
describe('Test Hello API', () => {
Expand All @@ -31,12 +31,12 @@ describe('Test Hello API', () => {
});

test('It should get the proper instances', () => {
expect($kms.hello().hello).toBe('kms-service');
expect($sns.hello().hello).toBe('sns-service');
expect($s3s.hello().hello).toBe('s3s-service');
expect($engine.$kms.hello().hello).toBe('kms-service');
expect($engine.$sns.hello().hello).toBe('sns-service');
expect($engine.$s3s.hello().hello).toBe('s3s-service');
});

test('It should get the unique id', () => {
expect($s3s.nextId().length).toBe('583b839c-aa9d-4ea1-a2d7-2e374ee1566a'.length);
expect($engine.$s3s.nextId().length).toBe('583b839c-aa9d-4ea1-a2d7-2e374ee1566a'.length);
});
});

0 comments on commit 33a5b3e

Please sign in to comment.