File tree 4 files changed +15
-6
lines changed
4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 2
2
All notable changes to this project will be documented in this file.
3
3
This project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
4
4
5
- ## [ 0.9.2 ] - 2016-08-01
5
+ ## [ 0.9.3 ] - 2016-08-01
6
6
- add "exists" global file path checker
7
7
8
8
- set "node_modules" to user project directory
9
+ - compile JS code to ES5 using the TypeScript compiler
10
+ - allows for both ES6 & TypeScript input
9
11
10
12
## [ 0.8.0] - 2016-06-28
11
13
- load with object
Original file line number Diff line number Diff line change @@ -3,9 +3,12 @@ var fs_1 = require('fs');
3
3
var process_console_log_1 = require ( 'process-console-log' ) ;
4
4
var exists_1 = require ( './exists' ) ;
5
5
var constants_1 = require ( './constants' ) ;
6
+ var ts = require ( 'typescript' ) ;
6
7
function writeTest ( config , testString ) {
7
8
return new Promise ( function ( resolve , reject ) {
8
- var output = process_console_log_1 . logger + exists_1 . default ( config . dir ) + testString ;
9
+ var output = process_console_log_1 . logger + exists_1 . default ( config . dir ) + ts . transpile ( testString , {
10
+ module : ts . ModuleKind . CommonJS
11
+ } ) ;
9
12
fs_1 . writeFile ( constants_1 . testPath , output , function ( err ) {
10
13
if ( err ) {
11
14
reject ( err ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " mocha-coderoad" ,
3
- "version" : " 0.9.2 " ,
3
+ "version" : " 0.9.3 " ,
4
4
"description" : " mocha test runner & reporter for atom-coderoad" ,
5
5
"main" : " lib/index.js" ,
6
6
"scripts" : {
28
28
"dependencies" : {
29
29
"mocha" : " ^3.0.0" ,
30
30
"node-file-exists" : " ^1.1.0" ,
31
- "process-console-log" : " ^0.2.2"
31
+ "process-console-log" : " ^0.2.2" ,
32
+ "typescript" : " ^1.8.10"
32
33
},
33
34
"devDependencies" : {
34
35
"chai" : " ^3.5.0" ,
Original file line number Diff line number Diff line change @@ -2,11 +2,14 @@ import {writeFile} from 'fs';
2
2
import { logger } from 'process-console-log' ;
3
3
import exists from './exists' ;
4
4
import { testPath } from './constants' ;
5
+ import * as ts from 'typescript' ;
5
6
6
7
export default function writeTest ( config , testString : string ) {
7
8
return new Promise ( ( resolve , reject ) => {
8
- // append logger
9
- const output = logger + exists ( config . dir ) + testString ;
9
+ // append logger, compile using ts compiler
10
+ const output = logger + exists ( config . dir ) + ts . transpile ( testString , {
11
+ module : ts . ModuleKind . CommonJS
12
+ } ) ;
10
13
// write test file
11
14
writeFile ( testPath , output , ( err ) => {
12
15
if ( err ) { reject ( err ) ; }
You can’t perform that action at this time.
0 commit comments