Skip to content

Commit

Permalink
fix(migration): Ignore non-renamed modules (#2309)
Browse files Browse the repository at this point in the history
* fix(migration): Ignore non-renamed modules
  + add a test for this.

* chore(migration): Remove log statement
  • Loading branch information
cpcallen authored Apr 5, 2024
1 parent d9caf5d commit 8c8b04d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/migration/bin/rename.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ class VersionRenamer {
// moduleA.exportA -> moduleC.exportB
// And we performed the module rename first, we wouldn't be able to detect
// the export rename.
this.renamings_.push({old: oldModulePath, new: newModulePath});
if (newModulePath !== oldModulePath) {
this.renamings_.push({old: oldModulePath, new: newModulePath});
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions plugins/migration/test/rename.mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ suite('Rename', function () {
test('a javascript program with multiple renames works correctly', function () {
const database = {
'1.0.0': [
{
oldName: 'Blockly',
exports: {}
},
{
oldName: 'Blockly.moduleA',
newName: 'Blockly.newModuleA',
Expand Down

0 comments on commit 8c8b04d

Please sign in to comment.