From 7cab19a2e4a89019f01073066c3d79f24559c472 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 23 Feb 2021 23:29:43 -0300 Subject: [PATCH] Check upgradeable paths in migrate-imports test (cherry picked from commit 4ee9fd77fd518028abbabbab6940671dba766e6a) --- scripts/migrate-imports.js | 1 + test/migrate-imports.test.js | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/migrate-imports.js b/scripts/migrate-imports.js index 63acce83c..5e9dcc44c 100755 --- a/scripts/migrate-imports.js +++ b/scripts/migrate-imports.js @@ -163,6 +163,7 @@ function getUpgradeablePath (file) { module.exports = { pathUpdates, updateImportPaths, + getUpgradeablePath, }; if (require.main === module) { diff --git a/test/migrate-imports.test.js b/test/migrate-imports.test.js index a85fce21e..0872033d3 100644 --- a/test/migrate-imports.test.js +++ b/test/migrate-imports.test.js @@ -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); + } } });