diff options
author | basil.belokon <basil.belokon@gmail.com> | 2017-12-03 15:58:09 +0600 |
---|---|---|
committer | Timmy Willison <4timmywil@gmail.com> | 2018-01-16 11:39:16 -0500 |
commit | 5d3a968e031ab8dff5c07e1d6bb4f196fb82bfa0 (patch) | |
tree | 8cb0c8082469f637c38ca90b5dc4c60b9c54f57f /test | |
parent | 428ee4a62488457a1bc568e7475cbf65b1feaf93 (diff) | |
download | jquery-5d3a968e031ab8dff5c07e1d6bb4f196fb82bfa0.tar.gz jquery-5d3a968e031ab8dff5c07e1d6bb4f196fb82bfa0.zip |
Manipulation: Add support for scripts with module type
Fixes gh-3871
Close gh-3869
Diffstat (limited to 'test')
-rw-r--r-- | test/data/inner_module.js | 1 | ||||
-rw-r--r-- | test/data/module.js | 1 | ||||
-rw-r--r-- | test/unit/manipulation.js | 16 |
3 files changed, 18 insertions, 0 deletions
diff --git a/test/data/inner_module.js b/test/data/inner_module.js new file mode 100644 index 000000000..a89a39d27 --- /dev/null +++ b/test/data/inner_module.js @@ -0,0 +1 @@ +window.ok( true, "evaluated: innert module with src" ); diff --git a/test/data/module.js b/test/data/module.js new file mode 100644 index 000000000..b0a8a21fd --- /dev/null +++ b/test/data/module.js @@ -0,0 +1 @@ +window.ok( true, "evaluated: module with src" ); diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 07ab43419..bfe41ed4e 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -1797,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 ); |