1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-16 11:03:59 +02:00

add testcase for js minify that produces $jscomp polyfills

with recent closure compiler default input language has changed from ES3 to ES6 produces $jscomp polyfills
This commit is contained in:
Elan Ruusamäe
2016-12-06 14:46:46 +02:00
parent b8c79ac8d4
commit 8949df33dd
4 changed files with 38 additions and 1 deletions

View File

@@ -80,12 +80,22 @@ class MinifyClosureCompilerTest extends TestCase
{
$this->assertHasJar();
$src = file_get_contents(self::$test_files . '/bug-513.js');
$src = $this->getDataFile('bug-513.js');
$minExpected = 'var a=4;';
$minOutput = Minify_ClosureCompiler::minify($src);
$this->assertSame($minExpected, $minOutput, 'advanced optimizations');
}
public function testOptions()
{
$this->assertHasJar();
$src = $this->getDataFile('js/jscomp.polyfill.js');
$exp = $this->getDataFile('js/jscomp.polyfill.min.js');
$res = Minify_ClosureCompiler::minify($src);
$this->assertSame($exp, $res);
}
protected function assertHasJar()
{
$this->assertNotEmpty(Minify_ClosureCompiler::$jarFile);