From be4b4be91ac876718a15db27ac5f92bbaddac628 Mon Sep 17 00:00:00 2001 From: CrispusDH Date: Sat, 1 Dec 2018 12:20:31 +0200 Subject: [PATCH 1/6] rework debugprint to ts --- lib/frameworks/{debugprint.js => debugprint.ts} | 11 ++++++----- lib/runner.ts | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) rename lib/frameworks/{debugprint.js => debugprint.ts} (58%) diff --git a/lib/frameworks/debugprint.js b/lib/frameworks/debugprint.ts similarity index 58% rename from lib/frameworks/debugprint.js rename to lib/frameworks/debugprint.ts index 0aaaa846a..8e15c6f47 100644 --- a/lib/frameworks/debugprint.js +++ b/lib/frameworks/debugprint.ts @@ -1,7 +1,8 @@ -var util = require('util'), - Logger = require('../logger').Logger; +import { Logger } from '../logger'; +import { Runner } from '../runner'; +import * as util from 'util'; -var logger = new Logger('debugger'); +const logger = new Logger('debugger'); /** * A debug framework which does not actually run any tests, just spits @@ -11,9 +12,9 @@ var logger = new Logger('debugger'); * @param {Array} specs Array of Directory Path Strings. * @return {Promise} Promise resolved with the test results */ -exports.run = (runner, specs) => { +export const run = (runner: Runner, specs: Array) => { return new Promise(resolve => { - logger.info('Resolved spec files: ' + util.inspect(specs)); + logger.info(`Resolved spec files: ${util.inspect(specs)}`); resolve({ failedCount: 0 }); diff --git a/lib/runner.ts b/lib/runner.ts index c9aff6131..be0028018 100644 --- a/lib/runner.ts +++ b/lib/runner.ts @@ -385,7 +385,7 @@ export class Runner extends EventEmitter { frameworkPath = './frameworks/mocha.js'; } else if (this.config_.framework === 'debugprint') { // Private framework. Do not use. - frameworkPath = './frameworks/debugprint.js'; + frameworkPath = './frameworks/debugprint.ts'; } else if (this.config_.framework === 'explorer') { // Private framework. Do not use. frameworkPath = './frameworks/explorer.js'; From 984e247094d3ea2ca92a6b72af3613253de84fc1 Mon Sep 17 00:00:00 2001 From: CrispusDH Date: Sat, 1 Dec 2018 12:25:40 +0200 Subject: [PATCH 2/6] fix formatting --- lib/frameworks/debugprint.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/frameworks/debugprint.ts b/lib/frameworks/debugprint.ts index 8e15c6f47..2bb6f8ebb 100644 --- a/lib/frameworks/debugprint.ts +++ b/lib/frameworks/debugprint.ts @@ -1,5 +1,5 @@ -import { Logger } from '../logger'; -import { Runner } from '../runner'; +import {Logger} from '../logger'; +import {Runner} from '../runner'; import * as util from 'util'; const logger = new Logger('debugger'); @@ -15,8 +15,6 @@ const logger = new Logger('debugger'); export const run = (runner: Runner, specs: Array) => { return new Promise(resolve => { logger.info(`Resolved spec files: ${util.inspect(specs)}`); - resolve({ - failedCount: 0 - }); + resolve({failedCount: 0}); }); }; \ No newline at end of file From 72b21853febf0e0f2964ba5c575446d0682ee963 Mon Sep 17 00:00:00 2001 From: CrispusDH Date: Sat, 1 Dec 2018 12:30:22 +0200 Subject: [PATCH 3/6] fix formatting v2 --- lib/frameworks/debugprint.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/frameworks/debugprint.ts b/lib/frameworks/debugprint.ts index 2bb6f8ebb..a343838e9 100644 --- a/lib/frameworks/debugprint.ts +++ b/lib/frameworks/debugprint.ts @@ -1,6 +1,6 @@ +import * as util from 'util'; import {Logger} from '../logger'; import {Runner} from '../runner'; -import * as util from 'util'; const logger = new Logger('debugger'); From 83957543e301d4a4982c41447baa4aa057012d36 Mon Sep 17 00:00:00 2001 From: CrispusDH Date: Sat, 1 Dec 2018 12:46:35 +0200 Subject: [PATCH 4/6] fix path to js --- lib/runner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/runner.ts b/lib/runner.ts index be0028018..c9aff6131 100644 --- a/lib/runner.ts +++ b/lib/runner.ts @@ -385,7 +385,7 @@ export class Runner extends EventEmitter { frameworkPath = './frameworks/mocha.js'; } else if (this.config_.framework === 'debugprint') { // Private framework. Do not use. - frameworkPath = './frameworks/debugprint.ts'; + frameworkPath = './frameworks/debugprint.js'; } else if (this.config_.framework === 'explorer') { // Private framework. Do not use. frameworkPath = './frameworks/explorer.js'; From 7cfc5e6759ea2214d392d1b2f40bbd2224905018 Mon Sep 17 00:00:00 2001 From: CrispusDH Date: Sat, 1 Dec 2018 15:50:29 +0200 Subject: [PATCH 5/6] EOF --- lib/frameworks/debugprint.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/frameworks/debugprint.ts b/lib/frameworks/debugprint.ts index a343838e9..461c018b4 100644 --- a/lib/frameworks/debugprint.ts +++ b/lib/frameworks/debugprint.ts @@ -17,4 +17,4 @@ export const run = (runner: Runner, specs: Array) => { logger.info(`Resolved spec files: ${util.inspect(specs)}`); resolve({failedCount: 0}); }); -}; \ No newline at end of file +}; From e7475bcf0ac09b35e6744192d05b86bdc4b44e61 Mon Sep 17 00:00:00 2001 From: CrispusDH Date: Tue, 18 Dec 2018 12:47:54 +0200 Subject: [PATCH 6/6] update debugprint --- lib/frameworks/debugprint.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/frameworks/debugprint.ts b/lib/frameworks/debugprint.ts index 461c018b4..4585d6393 100644 --- a/lib/frameworks/debugprint.ts +++ b/lib/frameworks/debugprint.ts @@ -1,6 +1,7 @@ import * as util from 'util'; import {Logger} from '../logger'; import {Runner} from '../runner'; +import {RunResults} from '../taskRunner'; const logger = new Logger('debugger'); @@ -12,7 +13,7 @@ const logger = new Logger('debugger'); * @param {Array} specs Array of Directory Path Strings. * @return {Promise} Promise resolved with the test results */ -export const run = (runner: Runner, specs: Array) => { +export const run = (runner: Runner, specs: Array): Promise => { return new Promise(resolve => { logger.info(`Resolved spec files: ${util.inspect(specs)}`); resolve({failedCount: 0});