Check upgradeable paths in migrate-imports test

This commit is contained in:
Francisco Giordano
2021-02-23 23:29:43 -03:00
parent c760fe9a2e
commit 4ee9fd77fd
2 changed files with 7 additions and 2 deletions

View File

@ -163,6 +163,7 @@ function getUpgradeablePath (file) {
module.exports = {
pathUpdates,
updateImportPaths,
getUpgradeablePath,
};
if (require.main === module) {

View File

@ -2,12 +2,16 @@ const path = require('path');
const { promises: fs, constants: { F_OK } } = require('fs');
const { expect } = require('chai');
const { pathUpdates, updateImportPaths } = require('../scripts/migrate-imports.js');
const { pathUpdates, updateImportPaths, getUpgradeablePath } = require('../scripts/migrate-imports.js');
describe('migrate-imports.js', function () {
it('every new path exists', async function () {
for (const p of Object.values(pathUpdates)) {
await fs.access(path.join('contracts', p), F_OK);
try {
await fs.access(path.join('contracts', p), F_OK);
} catch (e) {
await fs.access(path.join('contracts', getUpgradeablePath), F_OK);
}
}
});