Skip to content

Commit

Permalink
spec & package.json drop shelljs for fs-extra
Browse files Browse the repository at this point in the history
Co-authored-by: Christopher J. Brody <[email protected]>
Co-authored-by: Raphael von der Grün <[email protected]>
  • Loading branch information
Christopher J. Brody and raphinesse committed May 30, 2018
1 parent 68d4c9b commit 92a56ed
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"import-fresh": "^2.0.0",
"is-url": "^1.2.4",
"q": "^1.5.1",
"shelljs": "^0.8.2",
"valid-identifier": "0.0.1"
},
"devDependencies": {
Expand Down
13 changes: 6 additions & 7 deletions spec/create.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
under the License.
*/

var fs = require('fs');
const fs = require('fs-extra');

var path = require('path');

var shell = require('shelljs');
var requireFresh = require('import-fresh');

var create = require('..');
Expand All @@ -35,12 +35,11 @@ var project = path.join(tmpDir, appName);

// Setup and teardown test dirs
beforeEach(function () {
shell.rm('-rf', project);
shell.mkdir('-p', tmpDir);
fs.emptyDirSync(tmpDir);
});
afterEach(function () {
afterAll(function () {
process.chdir(path.join(__dirname, '..')); // Needed to rm the dir on Windows.
shell.rm('-rf', tmpDir);
fs.removeSync(tmpDir);
});

describe('cordova create checks for valid-identifier', function () {
Expand Down Expand Up @@ -342,7 +341,7 @@ describe('create end-to-end', function () {
});

it('should successfully run with existing, empty destination', function () {
shell.mkdir('-p', project);
fs.ensureDirSync(project);
return create(project, appId, appName, {}, events)
.then(checkProjectArtifactsWithPackageFromTemplate);
});
Expand Down
5 changes: 2 additions & 3 deletions spec/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
under the License.
*/

const fs = require('fs');
const fs = require('fs-extra');
const os = require('os');
const path = require('path');

const rewire = require('rewire');
const shell = require('shelljs');

// Disable regular console output during tests
const CordovaLogger = require('cordova-common').CordovaLogger;
Expand All @@ -44,7 +43,7 @@ function createWithMockFetch (dir, id, name, cfg, events) {
const fetchSpy = jasmine.createSpy('fetchSpy')
.and.callFake(() => Promise.resolve(mockFetchDest));

shell.cp('-R', templateDir, mockFetchDest);
fs.copySync(templateDir, mockFetchDest);
return createWith({fetch: fetchSpy})(dir, id, name, cfg, events)
.then(() => fetchSpy);
}
Expand Down

0 comments on commit 92a56ed

Please sign in to comment.