Skip to content

Commit 98dc479

Browse files
authored
Merge pull request #28 from dreambo8563/release
TC for baseClass
2 parents bdff861 + 56c87ef commit 98dc479

File tree

8 files changed

+35
-8
lines changed

8 files changed

+35
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<a name="1.1.6"></a>
2+
## [1.1.6](https://github.com/dreambo8563/vue-lazy-calc/compare/v1.1.5...v1.1.6) (2019-03-21)
3+
4+
5+
16
<a name="1.1.5"></a>
27
## [1.1.5](https://github.com/dreambo8563/vue-lazy-calc/compare/v1.1.4...v1.1.5) (2019-03-21)
38

jest.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,10 @@ module.exports = {
2121
testMatch: [
2222
"**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"
2323
],
24-
testURL: "http://localhost/"
24+
testURL: "http://localhost/",
25+
globals: {
26+
"ts-jest": {
27+
diagnostics: false
28+
}
29+
}
2530
};

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-lazy-calc",
3-
"version": "1.1.5",
3+
"version": "1.1.6",
44
"private": false,
55
"author": "dreambo8563",
66
"main": "dist/vue-lazy-calc.umd.min.js",

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface ILazyBase {
99
stream(s?: LazyCalc): LazyStream;
1010
}
1111
export class LazyBase {
12-
constructor() {}
12+
// constructor() {}
1313
static lazy(init: number | object = 0): LazyCalc {
1414
return new LazyCalc(init);
1515
}

tests/unit/main.spec.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { LazyBase } from "../../src/main";
1+
///<reference path="../../types/main.d.ts">
2+
///<reference path="../../types/vue.d.ts">
3+
import LazyPlugin, { LazyBase } from "../../src/main";
4+
import Vue from "vue";
25

36
describe("base class", () => {
47
it("lazy with init value", () => {
@@ -11,4 +14,19 @@ describe("base class", () => {
1114
const stream1 = LazyBase.stream(base1).add(base2);
1215
expect(stream1.value()).toBe(5);
1316
});
17+
it("stream without init value", () => {
18+
const base1 = LazyBase.lazy(1);
19+
const base2 = LazyBase.lazy(4);
20+
const stream1 = LazyBase.stream()
21+
.subtract(base1)
22+
.add(base2);
23+
expect(stream1.value()).toBe(3);
24+
});
25+
it("Vue instantce", () => {
26+
Vue.use(LazyPlugin);
27+
const base1 = Vue.$lzCalc.lazy(1);
28+
const base2 = Vue.$lzCalc.lazy(4);
29+
const stream1 = Vue.$lzCalc.stream(base1).add(base2);
30+
expect(stream1.value()).toBe(5);
31+
});
1432
});

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"baseUrl": ".",
1414
"types": ["jest", "webpack-env"],
1515
"declaration": true,
16-
// "typeRoots": ["types"],
16+
// "typeRoots": ["types", "node_modules/@types"],
1717
"outDir": "./types",
1818
"paths": {
1919
"@/*": ["src/*"]
@@ -24,7 +24,7 @@
2424
"src/**/*.ts",
2525
"src/**/*.tsx",
2626
"src/**/*.vue"
27-
// "tests/**/*.ts",
27+
// "tests/**/*.ts"
2828
// "tests/**/*.tsx"
2929
],
3030
"exclude": ["node_modules"]

types/main.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export interface ILazyBase {
88
stream(s?: LazyCalc): LazyStream;
99
}
1010
export declare class LazyBase {
11-
constructor();
1211
static lazy(init?: number | object): LazyCalc;
1312
static stream(s?: LazyCalc): LazyStream;
1413
}

0 commit comments

Comments
 (0)