Skip to content

Commit f64f02e

Browse files
committed
fix ts warnings
1 parent f834fd2 commit f64f02e

File tree

8 files changed

+14
-8
lines changed

8 files changed

+14
-8
lines changed

lib/exists.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
var fs = require('fs');
33
function fileExists(path) {
44
try {
5-
fs.accessSync(path, fs.R_OK | fs.W_OK);
5+
fs.accessSync(path, fs.F_OK);
66
}
77
catch (e) {
88
if (e) {

lib/utils.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
"use strict";
2-
exports.signal = '@@@CodeRoad Results@@@';
1+
"use strict";
2+
exports.signal = '@@@CodeRoad Results@@@';

src/exists.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from 'fs';
22

33
export function fileExists(path: string): boolean {
44
try {
5-
fs.accessSync(path, fs.R_OK | fs.W_OK);
5+
fs.accessSync(path, fs.F_OK);
66
} catch (e) {
77
if (e) {
88
if (e.code !== 'ENOENT') {

src/runner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default function runner(testFile: string, config: CR.Config,
3636
// fail: return first failure
3737
final = result.failures[0];
3838
} else {
39-
console.log('error processing result: ', result)
39+
console.log('error processing result: ', result);
4040
}
4141

4242
final.change = final.taskPosition - config.taskPosition;

src/typings/cr.d.ts renamed to src/typings/cr/cr.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ interface TestResult {
2424
}
2525

2626
}
27+
28+
interface Process {
29+
resourcesPath: string;
30+
}

src/typings/node/node.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ declare module NodeJS {
204204
export interface ReadWriteStream extends ReadableStream, WritableStream {}
205205

206206
export interface Process extends EventEmitter {
207+
resourcesPath?: string;
208+
env: any;
207209
stdout: WritableStream;
208210
stderr: WritableStream;
209211
stdin: ReadableStream;
@@ -212,7 +214,6 @@ declare module NodeJS {
212214
abort(): void;
213215
chdir(directory: string): void;
214216
cwd(): string;
215-
env: any;
216217
exit(code?: number): void;
217218
getgid(): number;
218219
setgid(id: number): void;
@@ -430,7 +431,7 @@ declare module "http" {
430431
import * as events from "events";
431432
import * as net from "net";
432433
import * as stream from "stream";
433-
434+
434435
export interface RequestOptions {
435436
protocol?: string;
436437
host?: string;

src/typings/tsd.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/// <reference path="es6-promise/es6-promise.d.ts" />
33
/// <reference path="mocha/mocha.d.ts" />
44
/// <reference path="node/node.d.ts" />
5+
/// <reference path="cr/cr.d.ts" />

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"src/runner.ts",
2222
"src/utils.ts",
2323
"src/typings/chai/chai.d.ts",
24-
"src/typings/cr.d.ts",
24+
"src/typings/cr/cr.d.ts",
2525
"src/typings/es6-promise/es6-promise.d.ts",
2626
"src/typings/mocha/mocha.d.ts",
2727
"src/typings/node/node.d.ts",

0 commit comments

Comments
 (0)