Skip to content

Commit

Permalink
rename main.ts to main-ts.ts, so that resolver does not return main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
bumblehead committed Sep 13, 2023
1 parent ed4dcd5 commit ecefd8d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 14 deletions.
7 changes: 0 additions & 7 deletions tests/local/main.ts

This file was deleted.

4 changes: 2 additions & 2 deletions tests/tests-FAIL-swc/esmock.node-swc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import esmock from 'esmock'
// when the typescript sytax are removed, tests pass

test('should mock ts when using node-ts', async () => {
const main = await esmock('../local/main.ts', {
const main = await esmock('../local/main-ts.ts', {
path: {
basename: () => 'hellow'
}
Expand All @@ -17,7 +17,7 @@ test('should mock ts when using node-ts', async () => {
})

test('should mock pg', async () => {
const main = await esmock('../local/main.ts', {
const main = await esmock('../local/main-ts.ts', {
'pg': {
Pool: (config:any) => {
return config || 'mocked pool'
Expand Down
2 changes: 1 addition & 1 deletion tests/tests-FAIL-tsx/esmock.node.tsx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('should mock js when using tsx', async () => {
// tsx fails :/ https://github.com/esbuild-kit/tsx/issues/264
//
// test('should mock ts when using tsx - unknown file extension', async () => {
// const main = await esmock('../local/main.ts', {
// const main = await esmock('../local/main-ts.ts', {
// path: {
// basename: () => 'hellow'
// }
Expand Down
3 changes: 1 addition & 2 deletions tests/tests-nodets/esmock.node-ts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import assert from 'assert'
import esmock from 'esmock'

test('should mock ts when using node-ts', { only: true }, async () => {
const main = await esmock('../local/main.ts', {
const main = await esmock('../local/main-ts.ts', {
path: {
basename: () => 'hellow'
}
Expand All @@ -26,4 +26,3 @@ test('should mock import global at import tree w/ mixed esm cjs', async () => {
assert.equal(consolelog.mock.calls[0].arguments[0], 'foo')
assert.equal(consolelog.mock.calls[1].arguments[0], 'foo')
})

4 changes: 2 additions & 2 deletions tests/tests-tsm/esmock.node-tsm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import assert from 'assert'
import esmock from 'esmock'

test('should mock ts when using node-ts', async () => {
const main = await esmock('../local/main.ts', {
const main = await esmock('../local/main-ts.ts', {
path: {
basename: () => 'hellow'
}
Expand All @@ -14,7 +14,7 @@ test('should mock ts when using node-ts', async () => {
})

test('should mock pg', async () => {
const main = await esmock('../local/main.ts', {
const main = await esmock('../local/main-ts.ts', {
'pg': {
Pool: (config:any) => {
return config || 'mocked pool'
Expand Down

0 comments on commit ecefd8d

Please sign in to comment.