File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ export class AccountManager extends EventEmitter {
178
178
static newTemporary ( ) {
179
179
let directory = null
180
180
while ( true ) {
181
- const randomString = Math . random ( ) . toString ( 36 ) . substr ( 2 , 5 )
181
+ const randomString = Math . random ( ) . toString ( 36 ) . substring ( 2 , 5 )
182
182
directory = join ( tmpdir ( ) , 'deltachat-' + randomString )
183
183
if ( ! existsSync ( directory ) ) break
184
184
}
Original file line number Diff line number Diff line change 1
1
// @ts -check
2
- import DeltaChat from '../dist'
2
+ import { DeltaChat } from '../dist/index.js '
3
3
4
4
import { deepStrictEqual , strictEqual } from 'assert'
5
5
import chai , { expect } from 'chai'
6
6
import chaiAsPromised from 'chai-as-promised'
7
- import { EventId2EventName , C } from '../dist/constants'
7
+ import { EventId2EventName , C } from '../dist/constants.js '
8
8
import { join } from 'path'
9
9
import { statSync } from 'fs'
10
- import { Context } from '../dist/context'
10
+ import { Context } from '../dist/context.js'
11
+ import { fileURLToPath } from 'url' ;
12
+
13
+ const __dirname = fileURLToPath ( new URL ( '.' , import . meta. url ) ) ;
14
+
11
15
chai . use ( chaiAsPromised )
12
16
chai . config . truncateThreshold = 0 // Do not truncate assertion errors.
13
17
Original file line number Diff line number Diff line change 10
10
"@types/node" : " ^20.8.10" ,
11
11
"chai" : " ~4.3.10" ,
12
12
"chai-as-promised" : " ^7.1.1" ,
13
- "esm" : " ^3.2.25" ,
14
13
"mocha" : " ^8.2.1" ,
15
14
"node-gyp" : " ^10.0.0" ,
16
15
"prebuildify" : " ^5.0.1" ,
53
52
"prebuildify" : " cd node && prebuildify -t 18.0.0 --napi --strip --postinstall \" node scripts/postinstall.js --prebuild\" " ,
54
53
"test" : " npm run test:lint && npm run test:mocha" ,
55
54
"test:lint" : " npm run lint" ,
56
- "test:mocha" : " mocha -r esm node/test/test.js --growl --reporter=spec --bail --exit"
55
+ "test:mocha" : " mocha node/test/test.mjs --growl --reporter=spec --bail --exit"
57
56
},
58
57
"types" : " node/dist/index.d.ts" ,
59
58
"version" : " 1.133.0"
You can’t perform that action at this time.
0 commit comments