diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6345bf0..70d1c4a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+
+## [1.1.6](https://github.com/dreambo8563/vue-lazy-calc/compare/v1.1.5...v1.1.6) (2019-03-21)
+
+
+
## [1.1.5](https://github.com/dreambo8563/vue-lazy-calc/compare/v1.1.4...v1.1.5) (2019-03-21)
diff --git a/jest.config.js b/jest.config.js
index b113645..17a4b95 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -21,5 +21,10 @@ module.exports = {
testMatch: [
"**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"
],
- testURL: "http://localhost/"
+ testURL: "http://localhost/",
+ globals: {
+ "ts-jest": {
+ diagnostics: false
+ }
+ }
};
diff --git a/package-lock.json b/package-lock.json
index fd53571..cf6ae66 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "vue-lazy-calc",
- "version": "1.1.5",
+ "version": "1.1.6",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index 942d85f..e19b080 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "vue-lazy-calc",
- "version": "1.1.5",
+ "version": "1.1.6",
"private": false,
"author": "dreambo8563",
"main": "dist/vue-lazy-calc.umd.min.js",
diff --git a/src/main.ts b/src/main.ts
index a909e92..3e5ccd5 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -9,7 +9,7 @@ export interface ILazyBase {
stream(s?: LazyCalc): LazyStream;
}
export class LazyBase {
- constructor() {}
+ // constructor() {}
static lazy(init: number | object = 0): LazyCalc {
return new LazyCalc(init);
}
diff --git a/tests/unit/main.spec.ts b/tests/unit/main.spec.ts
index a44c4d7..3365cba 100644
--- a/tests/unit/main.spec.ts
+++ b/tests/unit/main.spec.ts
@@ -1,4 +1,7 @@
-import { LazyBase } from "../../src/main";
+///
+///
+import LazyPlugin, { LazyBase } from "../../src/main";
+import Vue from "vue";
describe("base class", () => {
it("lazy with init value", () => {
@@ -11,4 +14,19 @@ describe("base class", () => {
const stream1 = LazyBase.stream(base1).add(base2);
expect(stream1.value()).toBe(5);
});
+ it("stream without init value", () => {
+ const base1 = LazyBase.lazy(1);
+ const base2 = LazyBase.lazy(4);
+ const stream1 = LazyBase.stream()
+ .subtract(base1)
+ .add(base2);
+ expect(stream1.value()).toBe(3);
+ });
+ it("Vue instantce", () => {
+ Vue.use(LazyPlugin);
+ const base1 = Vue.$lzCalc.lazy(1);
+ const base2 = Vue.$lzCalc.lazy(4);
+ const stream1 = Vue.$lzCalc.stream(base1).add(base2);
+ expect(stream1.value()).toBe(5);
+ });
});
diff --git a/tsconfig.json b/tsconfig.json
index 39380eb..84cb439 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -13,7 +13,7 @@
"baseUrl": ".",
"types": ["jest", "webpack-env"],
"declaration": true,
- // "typeRoots": ["types"],
+ // "typeRoots": ["types", "node_modules/@types"],
"outDir": "./types",
"paths": {
"@/*": ["src/*"]
@@ -24,7 +24,7 @@
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue"
- // "tests/**/*.ts",
+ // "tests/**/*.ts"
// "tests/**/*.tsx"
],
"exclude": ["node_modules"]
diff --git a/types/main.d.ts b/types/main.d.ts
index 93232f1..d48fa82 100644
--- a/types/main.d.ts
+++ b/types/main.d.ts
@@ -8,7 +8,6 @@ export interface ILazyBase {
stream(s?: LazyCalc): LazyStream;
}
export declare class LazyBase {
- constructor();
static lazy(init?: number | object): LazyCalc;
static stream(s?: LazyCalc): LazyStream;
}