Skip to content

Commit 43fef4c

Browse files
committed
Merged mobx into master
2 parents c6484bd + 4dff7c7 commit 43fef4c

File tree

8 files changed

+137
-55
lines changed

8 files changed

+137
-55
lines changed

CHANGELOG.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

jspm.config.js

Lines changed: 101 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ SystemJS.config({
1010
devConfig: {
1111
"map": {
1212
"plugin-typescript": "github:frankwallis/plugin-typescript@4.0.16",
13-
"systemjs-hot-reloader": "github:capaj/systemjs-hot-reloader@0.6.0"
13+
"systemjs-hot-reloader": "github:capaj/systemjs-hot-reloader@0.6.0",
14+
"blue-tape": "npm:blue-tape@0.2.0"
1415
},
1516
"packages": {
1617
"github:frankwallis/plugin-typescript@4.0.16": {
@@ -29,6 +30,97 @@ SystemJS.config({
2930
"debug": "npm:debug@2.2.0",
3031
"socket.io-client": "github:socketio/socket.io-client@1.4.8"
3132
}
33+
},
34+
"npm:blue-tape@0.2.0": {
35+
"map": {
36+
"tape": "npm:tape@4.6.0"
37+
}
38+
},
39+
"npm:tape@4.6.0": {
40+
"map": {
41+
"resumer": "npm:resumer@0.0.0",
42+
"function-bind": "npm:function-bind@1.1.0",
43+
"has": "npm:has@1.0.1",
44+
"glob": "npm:glob@7.0.5",
45+
"deep-equal": "npm:deep-equal@1.0.1",
46+
"object-inspect": "npm:object-inspect@1.2.1",
47+
"string.prototype.trim": "npm:string.prototype.trim@1.1.2",
48+
"minimist": "npm:minimist@1.2.0",
49+
"defined": "npm:defined@1.0.0",
50+
"inherits": "npm:inherits@2.0.1",
51+
"through": "npm:through@2.3.8",
52+
"resolve": "npm:resolve@1.1.7"
53+
}
54+
},
55+
"npm:has@1.0.1": {
56+
"map": {
57+
"function-bind": "npm:function-bind@1.1.0"
58+
}
59+
},
60+
"npm:string.prototype.trim@1.1.2": {
61+
"map": {
62+
"function-bind": "npm:function-bind@1.1.0",
63+
"es-abstract": "npm:es-abstract@1.5.1",
64+
"define-properties": "npm:define-properties@1.1.2"
65+
}
66+
},
67+
"npm:glob@7.0.5": {
68+
"map": {
69+
"inherits": "npm:inherits@2.0.1",
70+
"inflight": "npm:inflight@1.0.5",
71+
"minimatch": "npm:minimatch@3.0.2",
72+
"once": "npm:once@1.3.3",
73+
"path-is-absolute": "npm:path-is-absolute@1.0.0",
74+
"fs.realpath": "npm:fs.realpath@1.0.0"
75+
}
76+
},
77+
"npm:resumer@0.0.0": {
78+
"map": {
79+
"through": "npm:through@2.3.8"
80+
}
81+
},
82+
"npm:inflight@1.0.5": {
83+
"map": {
84+
"once": "npm:once@1.3.3",
85+
"wrappy": "npm:wrappy@1.0.2"
86+
}
87+
},
88+
"npm:es-abstract@1.5.1": {
89+
"map": {
90+
"function-bind": "npm:function-bind@1.1.0",
91+
"es-to-primitive": "npm:es-to-primitive@1.1.1",
92+
"is-callable": "npm:is-callable@1.1.3",
93+
"is-regex": "npm:is-regex@1.0.3"
94+
}
95+
},
96+
"npm:once@1.3.3": {
97+
"map": {
98+
"wrappy": "npm:wrappy@1.0.2"
99+
}
100+
},
101+
"npm:minimatch@3.0.2": {
102+
"map": {
103+
"brace-expansion": "npm:brace-expansion@1.1.5"
104+
}
105+
},
106+
"npm:define-properties@1.1.2": {
107+
"map": {
108+
"foreach": "npm:foreach@2.0.5",
109+
"object-keys": "npm:object-keys@1.0.11"
110+
}
111+
},
112+
"npm:es-to-primitive@1.1.1": {
113+
"map": {
114+
"is-callable": "npm:is-callable@1.1.3",
115+
"is-symbol": "npm:is-symbol@1.0.1",
116+
"is-date-object": "npm:is-date-object@1.0.1"
117+
}
118+
},
119+
"npm:brace-expansion@1.1.5": {
120+
"map": {
121+
"concat-map": "npm:concat-map@0.0.1",
122+
"balanced-match": "npm:balanced-match@0.4.1"
123+
}
32124
}
33125
}
34126
},
@@ -92,7 +184,7 @@ SystemJS.config({
92184
packages: {
93185
"github:jspm/nodelibs-buffer@0.2.0-alpha": {
94186
"map": {
95-
"buffer-browserify": "npm:buffer@4.7.0"
187+
"buffer-browserify": "npm:buffer@4.7.1"
96188
}
97189
},
98190
"github:jspm/nodelibs-http@0.2.0-alpha": {
@@ -127,13 +219,6 @@ SystemJS.config({
127219
"querystring": "npm:querystring@0.2.0"
128220
}
129221
},
130-
"npm:buffer@4.7.0": {
131-
"map": {
132-
"ieee754": "npm:ieee754@1.1.6",
133-
"isarray": "npm:isarray@1.0.0",
134-
"base64-js": "npm:base64-js@1.1.2"
135-
}
136-
},
137222
"npm:readable-stream@2.1.4": {
138223
"map": {
139224
"inherits": "npm:inherits@2.0.1",
@@ -375,6 +460,13 @@ SystemJS.config({
375460
"inherits": "npm:inherits@2.0.1",
376461
"minimalistic-assert": "npm:minimalistic-assert@1.0.0"
377462
}
463+
},
464+
"npm:buffer@4.7.1": {
465+
"map": {
466+
"isarray": "npm:isarray@1.0.0",
467+
"base64-js": "npm:base64-js@1.1.2",
468+
"ieee754": "npm:ieee754@1.1.6"
469+
}
378470
}
379471
}
380472
});

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@
2525
"deploy": "cd dist && git checkout gh-pages && git add --all && git commit -m \"New Release\" && git push",
2626
"bd": "npm run build && npm run deploy",
2727
"bdd": "npm run build-deps && npm run deploy",
28-
"test": "echo \"Tests to be added soon!\"",
28+
"test": "jspm run src/test-runner | faucet",
2929
"lint": "tslint ./src/**/*.ts*"
3030
},
3131
"devDependencies": {
32+
"@types/blue-tape": "^0.1.29",
3233
"@types/react": "^0.14.27",
3334
"@types/react-dom": "^0.14.13",
35+
"@types/tape": "^4.2.27",
36+
"faucet": "0.0.1",
3437
"husky": "^0.11.4",
3538
"jspm": "^0.17.0-beta.22",
3639
"jspm-hmr": "^0.4.2",
@@ -46,6 +49,7 @@
4649
"react-dom": "npm:react-dom@^15.2.1"
4750
},
4851
"devDependencies": {
52+
"blue-tape": "npm:blue-tape@^0.2.0",
4953
"plugin-typescript": "github:frankwallis/plugin-typescript@^4.0.16",
5054
"systemjs-hot-reloader": "github:capaj/systemjs-hot-reloader@^0.6.0"
5155
},

src/app-typings.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/// <reference path="../typings/index.d.ts" />
2-
31
declare const System: any;
42

53
declare module 'example-module' {

src/stores/app-store.spec.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import {AppStore} from './app-store';
2+
import test from 'blue-tape';
3+
4+
test('should create empty Store asynchronously', async function(t) {
5+
function createStorePromise() {
6+
return Promise.resolve(new AppStore());
7+
}
8+
9+
t.equal((await createStorePromise()) instanceof AppStore, true);
10+
});
11+
12+
test('should create empty Store', function(t) {
13+
const appStore = new AppStore();
14+
15+
t.equal(appStore instanceof AppStore, true);
16+
t.end();
17+
});

src/stores/app-store.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
// app data models
2+
export class AppStore {
3+
userData: UserData;
4+
5+
constructor(initialState?: UserData) {
6+
this.userData = initialState || null;
7+
}
8+
}
9+
210
export class UserData {
311
name: string;
412
age: number;
513
complete: boolean;
14+
615
constructor(name: string, age: number) {
716
this.name = name;
817
this.age = age;
9-
this.complete = true;
18+
this.complete = false;
1019
}
1120
}
12-
13-
export class AppStore {
14-
userData: UserData;
15-
16-
constructor(initialState?: UserData) {
17-
this.userData = initialState || null;
18-
}
19-
20-
}

src/test-runner.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import './stores/app-store.spec';

src/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
"app.tsx",
3131
"components/main.tsx",
3232
"components/user-profile.tsx",
33-
"stores/app-store.tsx"
33+
"stores/app-store.spec.tsx",
34+
"stores/app-store.tsx",
35+
"test-runner.tsx"
3436
],
3537
"atom": {
3638
"rewriteTsconfig": true,

0 commit comments

Comments
 (0)