forked from mcollina/desm
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
32 lines (26 loc) · 905 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import test from 'tape'
import desm from './index.js'
import { fileURLToPath } from 'url'
import { dirname, join } from 'path'
import {
dirname as urlDirname,
filename,
join as urlJoin
} from './index.js'
test('carbon copy', async ({ is }) => {
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
is(desm(import.meta.url), __dirname)
is(urlDirname(import.meta.url), __dirname)
is(filename(import.meta.url), __filename)
})
test('join stuff', async ({ is }) => {
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
is(urlJoin(import.meta.url, 'routes'), join(__dirname, 'routes'))
})
test('join stuff (concat)', async ({ is }) => {
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
is(urlJoin(import.meta.url, '..', 'routes'), join(__dirname, '..', 'routes'))
})