Browse Source

Outputting function source to the test server table

v1.x
Tj Holowaychuk 14 years ago
parent
commit
c4bfb3355f
  1. 9
      test/public/app.js
  2. 10
      test/public/style.css
  3. 1
      test/views/tests.jade

9
test/public/app.js

@ -12,15 +12,20 @@ function create(type) {
function runTests() {
var table = get('tests');
for (var name in tests) {
var canvas = create('canvas')
var fn = tests[name]
, canvas = create('canvas')
, tr = create('tr')
, tds = [create('td'), create('td')];
, tds = [create('td'), create('td'), create('td')]
, src = create('pre');
src.innerText = fn.toString();
canvas.width = 200;
canvas.height = 200;
canvas.title = name;
tds[1].appendChild(canvas);
tds[2].appendChild(src);
tr.appendChild(tds[0]);
tr.appendChild(tds[1]);
tr.appendChild(tds[2]);
table.appendChild(tr);
runTest(name, canvas, tds[0]);
}

10
test/public/style.css

@ -15,9 +15,15 @@ canvas, img {
padding: 5px;
border: 1px solid #eee;
}
#primary {
width: 600px;
pre {
height: 200px;
font-size: 12px;
overflow: auto;
}
p.msg {
width: 400px;
}
#tests {
width: 100%;
margin-top: 35px;
}

1
test/views/tests.jade

@ -9,4 +9,5 @@ table#tests
thead
th node-canvas
th target
th source
tbody
Loading…
Cancel
Save