Skip to content

Commit ed254dd

Browse files
committed
remove tests from src
1 parent 9899f02 commit ed254dd

9 files changed

+263
-146
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports = {
2424
"@typescript-eslint/no-unused-vars": "error",
2525
"@typescript-eslint/explicit-function-return-type": "off",
2626

27+
"@typescript-eslint/explicit-module-boundary-types": "off",
2728
"@typescript-eslint/no-empty-function": "off",
2829
"@typescript-eslint/ban-ts-ignore": "off",
2930
"@typescript-eslint/camelcase": "off",

.mocharc.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// This config file contains Mocha's defaults.
2+
// As you can see, comments are allowed.
3+
// This same configuration could be provided in the `mocha` property of your
4+
// project's `package.json`.
5+
// "test": "mocha src/**/*test.ts --exit --timeout 30000 --require ts-node/register --full-trace",
6+
{
7+
"diff": true,
8+
"extension": [
9+
"ts"
10+
],
11+
"opts": false,
12+
"package": "./package.json",
13+
"reporter": "spec",
14+
"require": "ts-node/register",
15+
"slow": 75,
16+
"timeout": 0,
17+
"ui": "bdd",
18+
"watch-files": [
19+
"src/**/*test.ts"
20+
],
21+
"watch-ignore": [
22+
"node_modules"
23+
]
24+
}

package-lock.json

+103-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"eslint": "eslint ./src --fix --ext=ts"
2222
},
2323
"lint-staged": {
24-
"*.{ts,tsx}": [
24+
"src/*.{ts,tsx}": [
2525
"yarn eslint"
2626
]
2727
},
@@ -82,6 +82,7 @@
8282
"mocha": "^8.2.1",
8383
"prettier": "^2.0.5",
8484
"rimraf": "^2.5.4",
85+
"ts-node": "^9.1.1",
8586
"tslint": "^5.11.0",
8687
"tslint-config-standard": "^8.0.1",
8788
"typescript": "^3.2.4"
@@ -90,6 +91,6 @@
9091
"typescript": ">=2.0"
9192
},
9293
"dependencies": {
93-
"@stoqey/sofa": "^0.1.4"
94+
"@stoqey/sofa": "^0.1.7"
9495
}
9596
}

src/index.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
import ServerlessCouchbaseConnection from './serverless.couchbase';
1+
import {QueryResult, SofaConnection} from '@stoqey/sofa';
2+
import ServerlessCouchbase, {ConfigArgs} from './serverless.couchbase';
23
export * from './serverless.couchbase';
3-
export const ServerlessCouchbase = ServerlessCouchbaseConnection;
4+
5+
SofaConnection.Instance;
6+
ServerlessCouchbase.Instance;
7+
8+
export const query = (query: string, options?: any): Promise<QueryResult> =>
9+
SofaConnection.Instance.cluster.query(query, options);
10+
11+
export const startCouchbase = async (couchbaseConfig: ConfigArgs): Promise<void> => {
12+
ServerlessCouchbase.Instance.config(couchbaseConfig);
13+
return await ServerlessCouchbase.Instance.connect();
14+
};
15+
416
export default ServerlessCouchbase;

0 commit comments

Comments
 (0)