Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

rework debugprint to ts #5074

Merged
merged 7 commits into from
Dec 19, 2018
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions lib/frameworks/debugprint.js → lib/frameworks/debugprint.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
var util = require('util'),
Logger = require('../logger').Logger;
import * as util from 'util';
import {Logger} from '../logger';
import {Runner} from '../runner';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`import {RunResults} from '../taskRunner';

We might need to update the RunResults to be more flexible:
https://github.com/angular/protractor/blob/selenium4/lib/taskRunner.ts#L9

export interface RunResults {
  taskId?: number;
  specs?: Array<string>;
  ...

var logger = new Logger('debugger');
const logger = new Logger('debugger');

/**
* A debug framework which does not actually run any tests, just spits
Expand All @@ -11,11 +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<string>) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export const run = (runner: Runner, specs: Array<string>): Promise<RunResults> => {

return new Promise(resolve => {
logger.info('Resolved spec files: ' + util.inspect(specs));
resolve({
failedCount: 0
});
logger.info(`Resolved spec files: ${util.inspect(specs)}`);
resolve({failedCount: 0});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the changes are made to RunResults you probably do not need to cast. If for some reason there are type errors, you might need to cast this to resolve({failedCount: 0} as RunResults);

});
};
};