Skip to content

Commit

Permalink
fix: rm rimraf, use fs.rm
Browse files Browse the repository at this point in the history
  • Loading branch information
ungoldman committed Jan 20, 2023
1 parent fc540c2 commit 59992a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"devDependencies": {
"git-pull-or-clone": "^2.0.1",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"snazzy": "^9.0.0",
"standard": "^17.0.0",
"tap-arc": "^0.3.4",
Expand Down
10 changes: 5 additions & 5 deletions test/get-defaults-test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const test = require('tape')
const fs = require('fs')
const path = require('path')
const tmp = require('tmp')
const gitPullOrClone = require('git-pull-or-clone')
const rimraf = require('rimraf')

const getDefaults = require('../bin/lib/get-defaults')
const remote = 'https://github.com/bcomnes/gh-release-test.git'

const GH_RELEASE_TEST_REPO = 'https://github.com/bcomnes/gh-release-test.git'

let repoDir, tmpDir

Expand All @@ -14,7 +14,7 @@ test('Set up test environment', function (t) {
tmpDir = tmp.dirSync({ unsafeCleanup: true })
repoDir = path.join(tmpDir.name, 'test-repo')
t.ok(tmpDir.name, 'valid tmp dir exists')
gitPullOrClone(remote, repoDir, function (err) {
gitPullOrClone(GH_RELEASE_TEST_REPO, repoDir, function (err) {
t.error(err, 'cloned test repo')
})
})
Expand Down Expand Up @@ -73,7 +73,7 @@ test('get-defaults errors out with an invalid repository URL', function (t) {

test('Clean up tests', function (t) {
t.plan(1)
rimraf(tmpDir.name, function (err) {
fs.rm(tmpDir.name, { recursive: true, force: true }, function (err) {
t.error(err, 'repo cleaned up')
})
})

0 comments on commit 59992a4

Please sign in to comment.