1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-19 04:11:20 +02:00

test $jscomp polyfill output

This commit is contained in:
Elan Ruusamäe
2016-12-06 17:00:58 +02:00
parent 6a330d9091
commit 8fe915f486
2 changed files with 19 additions and 2 deletions

View File

@@ -86,13 +86,27 @@ class MinifyClosureCompilerTest extends TestCase
$this->assertSame($minExpected, $minOutput, 'advanced optimizations');
}
public function testOptions()
/**
* Test that language_in parameter has effect.
*/
public function testLanguageOptions()
{
$this->assertHasJar();
$src = $this->getDataFile('js/jscomp.polyfill.js');
$exp = $this->getDataFile('js/jscomp.polyfill.min.js');
$res = Minify_ClosureCompiler::minify($src);
$options = array(
'language_in' => 'ECMASCRIPT3',
);
$res = Minify_ClosureCompiler::minify($src, $options);
$this->assertSame($exp, $res);
$options = array(
'language_in' => 'ECMASCRIPT6',
);
$exp = $this->getDataFile('js/jscomp.polyfilled.min.js');
$res = Minify_ClosureCompiler::minify($src, $options);
$this->assertSame($exp, $res);
}