Skip to content

Commit

Permalink
fix again!
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Feb 23, 2021
1 parent 921adca commit 80545e7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, TestInterface } from './testlib'
import { expect } from 'chai'
import { ChildProcess, exec as childProcessExec, ExecException, ExecOptions } from 'child_process'
import { join, resolve } from 'path'
import { join, resolve, sep as pathSep } from 'path'
import semver = require('semver')
import ts = require('typescript')
import proxyquire = require('proxyquire')
Expand Down Expand Up @@ -587,7 +587,8 @@ test.suite('ts-node', (test) => {

if (semver.gte(ts.version, '3.2.0')) {
test('--show-config should log resolved configuration', async (t) => {
function normalize (path: string) { return path.replace(/\\/g, '/') }
function native (path: string) { return JSON.stringify(path.replace(/\/|\\/g, pathSep)) }
function posix (path: string) { return JSON.stringify(path.replace(/\/|\\/g, '/')) }
const { err, stdout } = await exec(`${cmd} --showConfig`)
expect(err).to.equal(null)
t.is(stdout, [
Expand All @@ -598,8 +599,8 @@ test.suite('ts-node', (test) => {
` "noEmit": false,`,
` "strict": true,`,
` "typeRoots": [`,
` ${ JSON.stringify(normalize(`${ ROOT_DIR }/tests/typings`)) },`,
` ${ JSON.stringify(normalize(`${ ROOT_DIR }/node_modules/@types`)) }`,
` ${ posix(`${ ROOT_DIR }/tests/typings`) },`,
` ${ posix(`${ ROOT_DIR }/node_modules/@types`) }`,
` ],`,
` "sourceMap": true,`,
` "inlineSourceMap": false,`,
Expand All @@ -609,9 +610,9 @@ test.suite('ts-node', (test) => {
` "module": "commonjs"`,
` },`,
` "ts-node": {`,
` "cwd": ${ JSON.stringify(`${ ROOT_DIR }/tests`) },`,
` "projectSearchDir": ${ JSON.stringify(`${ ROOT_DIR }/tests`) },`,
` "project": ${ JSON.stringify(`${ ROOT_DIR }/tests/tsconfig.json`) },`,
` "cwd": ${ native(`${ ROOT_DIR }/tests`) },`,
` "projectSearchDir": ${ native(`${ ROOT_DIR }/tests`) },`,
` "project": ${ native(`${ ROOT_DIR }/tests/tsconfig.json`) },`,
` "require": []`,
` }`,
`}`,
Expand Down

0 comments on commit 80545e7

Please sign in to comment.