Check upgradeable paths in migrate-imports test

(cherry picked from commit 4ee9fd77fd)
release-v4.0
Francisco Giordano 4 years ago
parent 556cdf5f1a
commit 7cab19a2e4
  1. 1
      scripts/migrate-imports.js
  2. 8
      test/migrate-imports.test.js

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

@ -2,12 +2,16 @@ const path = require('path');
const { promises: fs, constants: { F_OK } } = require('fs'); const { promises: fs, constants: { F_OK } } = require('fs');
const { expect } = require('chai'); 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 () { describe('migrate-imports.js', function () {
it('every new path exists', async function () { it('every new path exists', async function () {
for (const p of Object.values(pathUpdates)) { 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);
}
} }
}); });

Loading…
Cancel
Save