@@ -16,44 +16,54 @@ import {
16
16
import Immutable from 'immutable' ;
17
17
18
18
describe ( 'load' , ( ) => {
19
- expect ( load ( 'mytest.ipynb' ) ) . to . deep . equal ( { type : 'LOAD' , filename : 'mytest.ipynb' } )
19
+ it ( 'loads a notebook' , ( ) => {
20
+ expect ( load ( 'mytest.ipynb' ) )
21
+ . to . deep . equal ( { type : 'LOAD' , filename : 'mytest.ipynb' } )
22
+ } )
20
23
} )
21
24
22
25
describe ( 'newNotebook' , ( ) => {
23
- expect ( newNotebook ( 'python3' , '/tmp' ) )
24
- . to . deep . equal ( {
25
- type : 'NEW_NOTEBOOK' ,
26
- kernelSpecName : 'python3' ,
27
- cwd : '/tmp' ,
28
- } )
26
+ it ( 'creates a new notebook' , ( ) => {
27
+ expect ( newNotebook ( 'python3' , '/tmp' ) )
28
+ . to . deep . equal ( {
29
+ type : 'NEW_NOTEBOOK' ,
30
+ kernelSpecName : 'python3' ,
31
+ cwd : '/tmp' ,
32
+ } )
33
+ } )
29
34
} )
30
35
31
36
describe ( 'notebookLoaded' , ( ) => {
32
- expect ( notebookLoaded ( 'test' , dummyCommutable ) )
33
- . to . deep . equal ( {
34
- type : 'SET_NOTEBOOK' ,
35
- filename : 'test' ,
36
- notebook : dummyCommutable ,
37
- } )
37
+ it ( 'sets a notebook' , ( ) => {
38
+ expect ( notebookLoaded ( 'test' , dummyCommutable ) )
39
+ . to . deep . equal ( {
40
+ type : 'SET_NOTEBOOK' ,
41
+ filename : 'test' ,
42
+ notebook : dummyCommutable ,
43
+ } )
44
+ } )
38
45
} )
39
46
40
- // This test will break the test suite on windows
41
- // describe('extractNewKernel', () => {
42
- // expect(extractNewKernel('/tmp/test.ipynb', dummyCommutable)).to.deep.equal({
43
- // type: 'LAUNCH_KERNEL',
44
- // kernelSpecName: 'python3',
45
- // cwd: '/tmp',
46
- // })
47
- // })
47
+ describe ( 'extractNewKernel' , ( ) => {
48
+ it ( 'extracts and launches the kernel from a notebook' , ( ) => {
49
+ expect ( extractNewKernel ( '/tmp/test.ipynb' , dummyCommutable ) ) . to . deep . equal ( {
50
+ type : 'LAUNCH_KERNEL' ,
51
+ kernelSpecName : 'python3' ,
52
+ cwd : '/tmp' ,
53
+ } )
54
+ } )
55
+ } )
48
56
49
57
describe ( 'convertRawNotebook' , ( ) => {
50
- const converted = convertRawNotebook ( {
51
- filename : '/tmp/test.ipynb' ,
52
- data : dummy ,
53
- } ) ;
54
- expect ( converted . filename ) . to . equal ( '/tmp/test.ipynb' ) ;
55
-
56
- const notebook = converted . notebook ;
57
- expect ( dummyCommutable . get ( 'metadata' ) . equals ( notebook . get ( 'metadata' ) ) )
58
- . to . be . true ;
58
+ it ( 'converts a raw notebook' , ( ) => {
59
+ const converted = convertRawNotebook ( {
60
+ filename : '/tmp/test.ipynb' ,
61
+ data : dummy ,
62
+ } ) ;
63
+ expect ( converted . filename ) . to . equal ( '/tmp/test.ipynb' ) ;
64
+
65
+ const notebook = converted . notebook ;
66
+ expect ( dummyCommutable . get ( 'metadata' ) . equals ( notebook . get ( 'metadata' ) ) )
67
+ . to . be . true ;
68
+ } )
59
69
} )
0 commit comments