|
1 | 1 | import { $ as $imported } from "jquery"; |
2 | | -import { $ as $required } from "./jquery-require.cjs"; |
| 2 | +import { $ as $slimImported } from "jquery/slim"; |
3 | 3 |
|
4 | | -console.assert( $required === $imported, |
5 | | - "Only one copy of jQuery should exist" ); |
| 4 | +import { jQueryFactory as jQueryFactoryImported } from "jquery/factory"; |
| 5 | +import { jQueryFactory as jQueryFactorySlimImported } from "jquery/factory-slim"; |
| 6 | + |
| 7 | +import { |
| 8 | + $required, |
| 9 | + $slimRequired, |
| 10 | + jQueryFactoryRequired, |
| 11 | + jQueryFactorySlimRequired |
| 12 | +} from "./jquery-require.cjs"; |
6 | 13 |
|
| 14 | +console.assert( $required === $imported, |
| 15 | + "Only one copy of full jQuery should exist" ); |
7 | 16 | console.assert( /^jQuery/.test( $imported.expando ), |
8 | | - "jQuery.expando should be detected" ); |
| 17 | + "jQuery.expando should be detected on full jQuery" ); |
| 18 | + |
| 19 | +console.assert( $slimRequired === $slimImported, |
| 20 | + "Only one copy of slim jQuery should exist" ); |
| 21 | +console.assert( /^jQuery/.test( $slimImported.expando ), |
| 22 | + "jQuery.expando should be detected on slim jQuery" ); |
| 23 | + |
| 24 | +console.assert( jQueryFactoryImported === jQueryFactoryRequired, |
| 25 | + "Only one copy of full jQueryFactory should exist" ); |
| 26 | +console.assert( !( "expando" in jQueryFactoryImported ), |
| 27 | + "jQuery.expando should not be attached to the full factory" ); |
| 28 | +const $fromFactory = jQueryFactoryImported( window ); |
| 29 | +console.assert( /^jQuery/.test( $fromFactory.expando ), |
| 30 | + "jQuery.expando should be detected on full jQuery from factory" ); |
| 31 | + |
| 32 | +console.assert( jQueryFactorySlimImported === jQueryFactorySlimRequired, |
| 33 | + "Only one copy of slim jQueryFactory should exist" ); |
| 34 | +console.assert( !( "expando" in jQueryFactorySlimImported ), |
| 35 | + "jQuery.expando should not be attached to the slim factory" ); |
| 36 | +const $fromFactorySlim = jQueryFactorySlimImported( window ); |
| 37 | +console.assert( /^jQuery/.test( $fromFactorySlim.expando ), |
| 38 | + "jQuery.expando should be detected on slim jQuery from factory" ); |
0 commit comments