Skip to content

Commit

Permalink
test(integration): just handle removing test files after test.
Browse files Browse the repository at this point in the history
trilom committed Mar 25, 2020
1 parent 7ce4f8b commit d4fe226
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
"build-release": "yarn build-package --minify",
"test": "jest",
"test-coverage": "jest --coverage",
"test-integration": "jest -c jest.config.integration.js",
"test-integration": "jest -c jest.config.integration.js && rm -rf src/tests/outputs",
"format": "prettier --write '**/*.ts'",
"format-check": "prettier --check '**/*.ts'",
"lint": "eslint --ext .ts ./",
14 changes: 0 additions & 14 deletions src/tests/integration.test.ts
Original file line number Diff line number Diff line change
@@ -15,13 +15,6 @@ let processStdoutMock: jest.SpyInstance
let consoleLogMock: jest.SpyInstance
let output = ''

function cleanupTest(path: string, ext: string): void {
;['files', 'files_modified', 'files_added', 'files_removed'].forEach(type => {
unlinkSync(`${path}/${type}${ext}`)
})
rmdirSync(path)
}

describe.each(p.testEvents)('Testing main.ts with %s event...', event => {
/**
* @function run
@@ -80,13 +73,6 @@ describe.each(p.testEvents)('Testing main.ts with %s event...', event => {
}
})
afterEach(() => {
cleanupTest(
_resolve(
__dirname,
`outputs/${event}/${eventName}/o_${outputName}f_${fileOutputName}`
),
fileOutputExpected
)
process.env = {...pEnv}
output = ''
jest.restoreAllMocks()

0 comments on commit d4fe226

Please sign in to comment.