mirror of
https://github.com/s4u/maven-settings-action.git
synced 2026-02-18 00:00:26 +08:00
add test coverage
This commit is contained in:
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user