Skip to content

Commit

Permalink
Fixed tests to make them more like the others and added CLI tests for…
Browse files Browse the repository at this point in the history
… node testing
  • Loading branch information
davglass committed Jan 4, 2013
1 parent fe5f639 commit 499acd6
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 27 deletions.
33 changes: 33 additions & 0 deletions src/timers/tests/cli/run.js
@@ -0,0 +1,33 @@
#!/usr/bin/env node

process.chdir(__dirname);

var YUITest = require('yuitest'),
path = require('path'),
fs = require('fs'),
dir = path.join(__dirname, '../../../../build-npm/'),
YUI = require(dir).YUI,
json;


YUI({useSync: true }).use('test', function(Y) {
Y.Test.Runner = YUITest.TestRunner;
Y.Test.Case = YUITest.TestCase;
Y.Test.Suite = YUITest.TestSuite;
Y.Assert = YUITest.Assert;

Y.applyConfig({
modules: {
'module-tests': {
fullpath: path.join(__dirname, '../unit/js/tests.js'),
requires: ['timers', 'test']
}
}
});

Y.use('module-tests');

Y.Test.Runner.setName('timers cli tests');

});

55 changes: 28 additions & 27 deletions src/timers/tests/unit/index.html
@@ -1,29 +1,30 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>
timers
</title>
<script src="/build/yui/yui.js">
</script>
<script src="js/tests.js">
</script>
</head>
<body class="yui3-skin-sam">
<div id="logger">
</div>
<script>
YUI({
coverage: [
'timers'
],
filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'raw'
}).use('test-console', 'test', 'module-tests', function (Y) {
(new Y.Test.Console()).render('#logger');
Y.Test.Runner.setName('timers');
Y.Test.Runner.run();
});
</script>
</body>
</html>
<head>
<meta charset="utf-8" />
<title>Timers</title>
<script src="../../../../build/yui/yui.js"> </script>
</head>
<body class="yui3-skin-sam">
<div id="logger">
</div>
<script>
YUI({
coverage: [
'timers'
],
modules: {
'module-tests': {
fullpath: './js/tests.js',
requires: ['timers', 'test']
}
},
filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'raw'
}).use('test-console', 'test', 'module-tests', function (Y) {
(new Y.Test.Console()).render('#logger');
Y.Test.Runner.setName('Timers');
Y.Test.Runner.run();
});
</script>
</body>
</html>

0 comments on commit 499acd6

Please sign in to comment.