@@ -12,7 +12,6 @@ const TestDummy = require('../fixtures/TestDummy')
12
12
const sander = require ( 'sander' )
13
13
const os = require ( 'os' )
14
14
const CSON = require ( '@rokt33r/season' )
15
- // const faker = require('faker')
16
15
17
16
const storagePath = path . join ( os . tmpdir ( ) , 'test/create-note-from-url' )
18
17
@@ -27,25 +26,14 @@ test.serial('Create a note from URL', (t) => {
27
26
28
27
const url = 'https://shapeshed.com/writing-cross-platform-node/'
29
28
30
- return Promise . resolve ( )
31
- . then ( function doTest ( ) {
32
- return Promise . all ( [
33
- createNoteFromUrl ( url , storageKey , folderKey )
34
- ] )
35
- } )
36
- . then ( function assert ( data ) {
37
- const data1 = data [ 0 ]
38
-
39
- console . log ( 'STORM LOOK HERE' , data1 )
40
-
41
- t . is ( storageKey , data1 . storage )
42
- const jsonData2 = CSON . readFileSync ( path . join ( storagePath , 'notes' , data1 . key + '.cson' ) )
29
+ return createNoteFromUrl ( url , storageKey , folderKey )
30
+ . then ( function assert ( { note } ) {
31
+ t . is ( storageKey , note . storage )
32
+ const jsonData = CSON . readFileSync ( path . join ( storagePath , 'notes' , note . key + '.cson' ) )
43
33
44
- // <<<<<< fix me - input2 & data not defined
45
- /* t.is(input2.content, data2.content)
46
- t.is(input2.content, jsonData2.content)
47
- t.is(input2.tags.length, data2.tags.length)
48
- t.is(input2.tags.length, jsonData2.tags.length) */
34
+ // Test if saved content is matching the created in memory note
35
+ t . is ( note . content , jsonData . content )
36
+ t . is ( note . tags . length , jsonData . tags . length )
49
37
} )
50
38
} )
51
39
0 commit comments