This repository was archived by the owner on Feb 22, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " back-loader" ,
3
3
"version" : " 0.1.3" ,
4
- "description" : " " ,
4
+ "description" : " a easy and steady preload lib " ,
5
5
"main" : " release/index" ,
6
6
"unpkg" : " release/index.js" ,
7
7
"author" : " WittBulter(nanazuimeng123@gmail.com)" ,
8
8
"homepage" : " https://github.com/DhyanaChina/back-loader#readme" ,
9
9
"license" : " MIT" ,
10
10
"scripts" : {
11
11
"test" : " ./node_modules/.bin/mocha" ,
12
- "cover:local" : " ./node_modules/.bin/nyc mocha && open coverage/lcov-report/index.html" ,
13
- "cover:hook" : " ./node_modules/.bin/nyc mocha && cat ./coverage/lcov.info | coveralls" ,
12
+ "cover:local" : " ./node_modules/.bin/nyc mocha; open coverage/lcov-report/index.html" ,
13
+ "cover:hook" : " ./node_modules/.bin/nyc mocha; cat ./coverage/lcov.info | coveralls" ,
14
14
"ex" : " tsc ./build/webpack.dev.ts && env DEBUG=true webpack-dev-server --config build/webpack.dev.js --inline --progress --port 1338 && npm run clean:tsc" ,
15
15
"ex:build" : " tsc ./build/webpack.prod.ts && rm -rf dist && webpack --config build/webpack.prod.js && npm run clean:tsc" ,
16
16
"release" : " tsc -p ./tsconfig.json" ,
Original file line number Diff line number Diff line change 1
1
import { EventHub } from '../../src/core/event'
2
- import { expect } from 'chai'
2
+ import { expect , assert } from 'chai'
3
3
import { install } from '../dom.nyc'
4
4
5
5
describe ( 'Core function test' , ( ) => {
@@ -23,4 +23,19 @@ describe('Core function test', () => {
23
23
hub . dispath ( 'test_listen_2' , 'once' )
24
24
} )
25
25
26
- } )
26
+ it ( 'should nerve receive any notice' , done => {
27
+ hub . listen ( 'test_listen_3' , ( e , d ) => expect . fail ( d , null ) )
28
+ hub . removeAll ( )
29
+ hub . dispath ( 'test_listen_3' , 'once' )
30
+ setTimeout ( done , 100 )
31
+ } )
32
+
33
+ it ( 'get an event and reject an event' , done => {
34
+ hub . listen ( 'test_listen_4' , ( ) => process . exit ( 1 ) )
35
+ hub . listen ( 'test_listen_5' , ( ) => done ( ) )
36
+ hub . remove ( 'test_listen_4' )
37
+ hub . dispath ( 'test_listen_4' , 'once' )
38
+ hub . dispath ( 'test_listen_5' , 'once' )
39
+ } )
40
+
41
+ } )
Original file line number Diff line number Diff line change 2
2
"compilerOptions" : {
3
3
"lib" : [" es2015" , " dom" ],
4
4
"target" : " es5" ,
5
- "module" : " es6" ,
6
- "moduleResolution" : " node" ,
7
5
"declaration" : true ,
8
6
"outDir" : " release/" ,
9
7
"sourceMap" : false ,
You can’t perform that action at this time.
0 commit comments