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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user