Skip to content
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

Using yogi test with other gallery modules #35

Closed
stlsmiths opened this issue Dec 15, 2012 · 4 comments
Closed

Using yogi test with other gallery modules #35

stlsmiths opened this issue Dec 15, 2012 · 4 comments
Assignees
Labels

Comments

@stlsmiths
Copy link

I have a gallery module, call it "moduleA" that I am developing and conducting unit tests on with "yogi test".

This "moduleA" has a required dependency for another gallery module (say "moduleB") so in a normal use case I would do YUI().use( "moduleA", "moduleB", ....

When I write the unit tests for "moduleA" the tests/unit/index.html looks like

<!doctype html>
<html>
<head>
    <title>moduleA tests</title>
    <script src="/build/yui/yui.js"></script>
    <script src="js/tests-modA.js"></script> <!-- YUI.add( 'module-tests-modA') -->
</head>
<body class="yui3-skin-sam">
<div id="logger"></div>

<script>
YUI({
    coverage: ['gallery-moduleA'],
    filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'raw'
}).use('gallery-moduleA', 'test-console', 'test', 'module-tests-modA',
    "gallery-moduleB",
...

But it seems like "gallery-moduleB" is not loaded (assuming it is relatively recent and is not in the current GA release build) and if I include a YUI config "gallery" property it doesn't seem to load these.

In this case assume that I don't have "moduleB" in the meta/moduleA.json "requires" but just include the dependency explicitly in the YUI.use command.

Is there a way to load existing gallery modules into a new module's "yogi test" unit tests (i.e. gallery: 'gallery-2012.xx.yy-zz') or am I completely doing this wrong ?

@davglass
Copy link
Member

This should work as long as the gallery module is published over the wire somewhere that yogi can get to it.

Can you put together a real example so I can see it breaking? My current tests show that it works for my use case.

@ghost ghost assigned davglass Dec 17, 2012
@stlsmiths
Copy link
Author

So this one fails, https://github.com/stlsmiths/new-gallery/blob/master/src/gallery-datatable-celleditor-popup/tests/unit/index.html
(If you uncomment gallery-datatable-celleditor-popup module)

It fails trying to load Y.Template, which is in this module's requires statement.

Not sure if this is because Y.Template is not in the yogi configured yui build, OR how I update the yui build on my system (... don't think I should have to)

@stlsmiths
Copy link
Author

image of yogi test fail
https://dl.dropbox.com/u/14338200/yogi-test.png

@davglass
Copy link
Member

davglass commented Jan 9, 2013

Willing to bet this is related to #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants