add test coverage

This commit is contained in:
Slawomir Jaranowski
2019-10-02 21:31:26 +02:00
parent b3d9019152
commit f803851b19
3 changed files with 67 additions and 7 deletions

View File

@ -3,7 +3,7 @@ const cp = require('child_process');
const path = require('path');
const fs = require('fs');
const testHomePath = path.join(__dirname, 'temp');
const testHomePath = fs.mkdtempSync(".m2");
const settingsPath = path.join(testHomePath, '.m2', 'settings.xml');
const indexPath = path.join(__dirname, 'index.js');
@ -19,16 +19,14 @@ afterEach(() => {
try {
fs.unlinkSync(settingsPath);
} catch (error) {
console.error(error.message);
}
});
afterAll(() => {
try {
fs.rmdirSync(path.join(testHomePath, ".m2"));
fs.rmdirSync(path.dirname(settingsPath));
fs.rmdirSync(testHomePath);
} catch (error) {
console.error(error.message);
}
});