-
Notifications
You must be signed in to change notification settings - Fork 40
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
Spec test update for define without dependencies, correction for anon_relative #17
Conversation
The original anon_relative was using logic required by config_path in order to properly test the relative path information. To remedy, the anon_relative has the path information removed, and a new test config_path_relative was created as part of the configPaths suite. This test ensures that relative modules remain relative to their module ID and not to their URL, even in the event of a path remap. Github ID: #13
Issue #14 references a situation where an empty dependency array denoted by [] should return no dependencies (as opposed to the normal require/exports/module combination). A define() call that does not contain any dependencies should receive the default require/module/exports combination.
Additionally, basic tests were commented for the libraries out of spec to ensure we don't miss when we break other things.
So I have been looking at the new test more closely and it seems that it will be a problem with loaders that do factory-on-require processing. The test is defining modules with the assumption that the factory call will be triggered by the define call itself. This won't work for loaders that follow the factory-on-require pattern (See https://groups.google.com/forum/?fromgroups=#!searchin/amd-implement/factory-on-define/amd-implement/ot46tE-N6L0/gUzoJhpsukIJ for more details). lsjs actually follows factory-on-require and the fix i delivered really isn't the correct solution for it. I think the test should look more like this where "require" is used to trigger the factory call.
|
I think that's pretty valid. If someone has factory-on-require, they would unfairly fail these tests, so we should ensure their factories are given the opportunity to run. I'll put together a PR that references this change |
Update on #17, Splits tests, uses internal require
Done and done. Thanks @rbackhouse for the assist! |
This creates 2 new tests:
define()
when there is dependencies defined asundefined
and when dependencies are defined as[]
This changes the following Library Compliance:
basic
until next rev, which resolvesbasic_empty_defs
basic
until next rev, which resolvesbasic_empty_defs
No current test suites are impacted by
config_paths_relative
.Referenced Issues:
This is a rollup for #13 #14 #15 #16