aboutsummaryrefslogtreecommitdiffstats
path: root/test/node_smoke_tests/lib/ensure_iterability_es6.js
blob: a948f1996d9f04c48d96c0c210b7dc5fa33e81aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"use strict";

const assert = require( "assert" );

const ensureIterability = () => {
	const { JSDOM } = require( "jsdom" );

	const { window } = new JSDOM( "" );

	let i;
	const ensureJQuery = require( "./ensure_jquery" );
	const jQuery = require( "../../../dist/jquery.js" )( window );
	const elem = jQuery( "<div></div><span></span><a></a>" );
	let result = "";

	ensureJQuery( jQuery );

	for ( i of elem ) {
		result += i.nodeName;
	}

	assert.strictEqual( result, "DIVSPANA", "for-of works on jQuery objects" );
};

module.exports = ensureIterability;