Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed tests to make them more like the others and added CLI tests for…

… node testing
  • Loading branch information...
commit 499acd66b9654b70cd9c53f915268d113eb7e290 1 parent fe5f639
Dav Glass davglass authored
Showing with 61 additions and 27 deletions.
  1. +33 −0 src/timers/tests/cli/run.js
  2. +28 −27 src/timers/tests/unit/index.html
33 src/timers/tests/cli/run.js
View
@@ -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 src/timers/tests/unit/index.html
View
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.