zjquery: Add $.create() method.

This commit add $.create(), which allows you to create a
jQuery object that just has a name to identify it, as opposed
to some selector or HTML fragment.  It's useful for things that
are really used as stubs.

This also fixes a bunch of the existing tests to use $.create().

Before this fix, you could actually just do $('some-stub'), but
now we enforce that the input to $() looks like a valid selector
or HTML fragment, and we make some exceptions for things like
window-stub and document-stub.
This commit is contained in:
Steve Howell
2017-07-08 09:16:19 -04:00
parent 90777fd1fa
commit 7376934a77
11 changed files with 147 additions and 104 deletions

View File

@@ -9,7 +9,7 @@ var with_overrides = global.with_overrides;
var people = global.people;
set_global('$', global.make_zjquery());
set_global('document', '');
set_global('document', 'document-stub');
set_global('alert_words', {
process_message: noop,