Skip to content

Commit b261a41

Browse files
committed
Added tests and changelog for .js.map files fix
1 parent aba2bac commit b261a41

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

docs/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt
1212
### Changed
1313
- Updated [.travis.dist.yml] to use Postgresql 9.6 (Moodle 3.10 new requirement).
1414

15+
### Fixed
16+
- `moodle-plugin-ci grunt` now also checks `*.js.map` files.
17+
1518
## [3.0.0] - 2020-07-23
1619
### Changed
1720
- ACTION REQUIRED: project organization renamed to moodlehq. You must update your `.travis.yml` to use `moodlehq/moodle-plugin-ci`

tests/Command/GruntCommandTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,25 @@ public function testValidatePluginFiles()
193193
$output = new BufferedOutput();
194194
$this->assertSame(1, $command->validatePluginFiles($output));
195195
$this->assertSame("File is newly generated and needs to be added: amd/build/new.min.js\n", $output->fetch());
196+
197+
$command->restorePlugin();
198+
$this->assertSame(0, $command->validatePluginFiles($emptyOutput));
199+
$this->assertSame('', $emptyOutput->fetch());
200+
201+
$this->fs->remove($this->pluginDir.'/amd/build/keys.min.js.map');
202+
203+
$output = new BufferedOutput();
204+
$this->assertSame(1, $command->validatePluginFiles($output));
205+
$this->assertSame("File no longer generated and likely should be deleted: amd/build/keys.min.js.map\n", $output->fetch());
206+
207+
$command->restorePlugin();
208+
$this->assertSame(0, $command->validatePluginFiles($emptyOutput));
209+
$this->assertSame('', $emptyOutput->fetch());
210+
211+
$this->fs->touch($this->pluginDir.'/amd/build/new.min.js.map');
212+
213+
$output = new BufferedOutput();
214+
$this->assertSame(1, $command->validatePluginFiles($output));
215+
$this->assertSame("File is newly generated and needs to be added: amd/build/new.min.js.map\n", $output->fetch());
196216
}
197217
}

0 commit comments

Comments
 (0)