New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manipulation: Add support script type module #3869

Closed
wants to merge 7 commits into
base: master
from
Prev

Manipulation: Add support script type module. Separated module-relate…

…d tests.
  • Loading branch information...
tbepdb committed Dec 11, 2017
commit 29260995034bacb8712543e669d8b8d1b8f9a947
View
@@ -1757,15 +1757,11 @@ function testHtml( valueObj, assert ) {
"<script type='something/else'>ok( false, 'evaluated: non-script' );</script>",
"<script type='text/javascript'>ok( true, 'evaluated: text/javascript' );</script>",
"<script type='text/ecmascript'>ok( true, 'evaluated: text/ecmascript' );</script>",
"<script type='module'>ok( true, 'evaluated: module' );</script>",
"<script type='module' src='./data/module.js'></script>",
"<script>ok( true, 'evaluated: no type' );</script>",
"<div>",
"<script type='something/else'>ok( false, 'evaluated: inner non-script' );</script>",
"<script type='text/javascript'>ok( true, 'evaluated: inner text/javascript' );</script>",
"<script type='text/ecmascript'>ok( true, 'evaluated: inner text/ecmascript' );</script>",
"<script type='module'>ok( true, 'evaluated: inner module' );</script>",
"<script type='module' src='./data/inner_module.js'></script>",
"<script>ok( true, 'evaluated: inner no type' );</script>",
"</div>"
].join( "" ) )
@@ -1801,6 +1797,22 @@ QUnit.test( "html(Function)", function( assert ) {
testHtml( manipulationFunctionReturningObj, assert );
} );
QUnit.test( "html(script type module)", function( assert ) {
assert.expect( 1 );
var fixture = jQuery( "#qunit-fixture" ),
tmp = fixture.html(
[
"<script type='module'>ok( true, 'evaluated: module' );</script>",
"<script type='module' src='./data/module.js'></script>",
"<div>",
"<script type='module'>ok( true, 'evaluated: inner module' );</script>",
"<script type='module' src='./data/inner_module.js'></script>",
"</div>"
].join( "" )
).find( "script" );
assert.equal( tmp.length, 4, "All script tags remain." );
} );
QUnit.test( "html(Function) with incoming value -- direct selection", function( assert ) {
assert.expect( 4 );
ProTip! Use n and p to navigate between commits in a pull request.