Skip to content

Commit f01e817

Browse files
author
dbale-altoros
committed
add: e2e test for import-check
1 parent aa0d6c5 commit f01e817

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

e2e/test.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ describe('e2e general tests', function () {
200200
beforeEach(() => {
201201
const padded = String(folderCounter).padStart(2, '0')
202202

203-
useFixtureFolder(PATH + 'repo' + padded)
203+
useFixtureFolder(this, PATH + 'repo' + padded)
204204

205205
folderCounter++
206206
})
@@ -242,22 +242,23 @@ describe('e2e general tests', function () {
242242

243243
function useFixture(dir) {
244244
beforeEach(`switch to ${dir}`, function () {
245-
useFixtureFolder(dir);
245+
useFixtureFolder(this, dir);
246246
})
247247
}
248248

249-
const useFixtureFolder = (dir) => {
249+
function useFixtureFolder(ctx, dir) {
250250
const fixturePath = path.join(__dirname, dir)
251251

252252
const tmpDirContainer = os.tmpdir()
253-
this.testDirPath = path.join(tmpDirContainer, `solhint-tests-${dir}`)
253+
const testDirPath = path.join(tmpDirContainer, `solhint-tests-${dir}`)
254254

255-
fs.ensureDirSync(this.testDirPath)
256-
fs.emptyDirSync(this.testDirPath)
255+
ctx.testDirPath = testDirPath
257256

258-
fs.copySync(fixturePath, this.testDirPath)
257+
fs.ensureDirSync(testDirPath)
258+
fs.emptyDirSync(testDirPath)
259+
fs.copySync(fixturePath, testDirPath)
259260

260-
shell.cd(this.testDirPath)
261+
shell.cd(testDirPath)
261262
}
262263

263264
function createDummyFile(fullFilePath, content = '// dummy file\npragma solidity ^0.8.0;') {

0 commit comments

Comments
 (0)