Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fs): Use graceful-fs instead of fs directly #221

Merged
merged 1 commit into from
Jan 26, 2017
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"escodegen": "^1.8.0",
"esprima": "^2.7.0",
"glob": "^7.0.3",
"graceful-fs": "^4.1.11",
"istanbul": "^0.4.5",
"lodash": "^3.10.1",
"log4js": "^0.6.33",
Expand All @@ -62,6 +63,7 @@
"@types/esprima": "^2.1.31",
"@types/estree": "0.0.32",
"@types/glob": "^5.0.29",
"@types/graceful-fs": "^2.0.29",
"@types/istanbul": "^0.4.29",
"@types/karma": "^0.13.32",
"@types/lodash": "^4.14.34",
Expand Down
2 changes: 1 addition & 1 deletion src/PluginLoader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as fs from 'fs';
import * as fs from 'graceful-fs';
import * as path from 'path';
import * as log4js from 'log4js';
import * as _ from 'lodash';
Expand Down
4 changes: 2 additions & 2 deletions src/utils/StrykerTempFolder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as os from 'os';
import * as fs from 'fs';
import * as fs from 'graceful-fs';
import * as path from 'path';
import * as mkdirp from 'mkdirp';
import * as fileUtils from './fileUtils';
Expand Down Expand Up @@ -77,7 +77,7 @@ function writeFile(filename: string, data: string): Promise<void> {
* Copies a file.
* @param fromFilename The path to the existing file.
* @param toFilename The path to copy the file to.
* @param instrumenter An optional additional intrumenter to stream the file through
* @param instrumenter An optional additional instrumenter to stream the file through
* @returns A promise to eventually copy the file.
*/
function copyFile(fromFilename: string, toFilename: string, instrumenter?: NodeJS.ReadWriteStream): Promise<void> {
Expand Down
8 changes: 3 additions & 5 deletions src/utils/fileUtils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use strict';

import * as path from 'path';
import * as os from 'os';
import * as fs from 'graceful-fs';
import * as _ from 'lodash';
import fs = require('fs');
import os = require('os');
import path = require('path');
import * as nodeGlob from 'glob';
import * as mkdirp from 'mkdirp';

Expand Down
2 changes: 1 addition & 1 deletion test/integration/utils/fileUtilsSpec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as fs from 'fs';
import * as fs from 'graceful-fs';
import { expect } from 'chai';
import * as sinon from 'sinon';
import * as fileUtils from '../../../src/utils/fileUtils';
Expand Down
8 changes: 4 additions & 4 deletions test/unit/PluginLoaderSpec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import PluginLoader from '../../src/PluginLoader';
import {expect} from 'chai';
import * as path from 'path';
import * as fs from 'graceful-fs';
import * as sinon from 'sinon';
import { expect } from 'chai';
import * as fileUtils from '../../src/utils/fileUtils';
import PluginLoader from '../../src/PluginLoader';
import log from '../helpers/log4jsMock';
import * as fs from 'fs';
import * as path from 'path';

describe('PluginLoader', () => {
let sut: PluginLoader;
Expand Down