Skip to content

Commit

Permalink
cleanup node-swc.test.ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
bumblehead committed Aug 15, 2023
1 parent 2d776aa commit 17b6cab
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions tests/tests-FAIL-swc/esmock.node-swc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@ import test from 'node:test'
import assert from 'assert'
import esmock from 'esmock'

// ⚠ https://github.com/swc-project/swc-node/issues/710
// swc tests fail when encountering typescript syntax
// when the typescript sytax are removed, tests pass

test('should mock ts when using node-ts', async () => {
const main = await import('../local/main.ts')
// const main = await import('../local/mainUtil.js')
console.log(main)
// const main = await import('../local/main.js')
/*
const main = await esmock('../local/main.ts', {
path: {
basename: () => 'hellow'
}
})*/
})

// assert.strictEqual(main.pathbasenamewrap(), 'hellow')
assert.ok(true)
assert.strictEqual(main.pathbasenamewrap(), 'hellow')
})
/*

test('should mock pg', async () => {
const main = await esmock('../local/main.ts', {
'pg': {
Expand All @@ -29,4 +27,3 @@ test('should mock pg', async () => {

assert.strictEqual(main.pgpoolwrap(), 'mocked pool')
})
*/

0 comments on commit 17b6cab

Please sign in to comment.