From c4bfb3355f1a0f15a7a6c8741b0c9f9d8cf2e611 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk <tj@vision-media.ca> Date: Thu, 4 Nov 2010 13:00:07 -0700 Subject: [PATCH] Outputting function source to the test server table --- test/public/app.js | 9 +++++++-- test/public/style.css | 10 ++++++++-- test/views/tests.jade | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/test/public/app.js b/test/public/app.js index 655f985..aeb5e7f 100644 --- a/test/public/app.js +++ b/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]); } diff --git a/test/public/style.css b/test/public/style.css index 3e779ae..9f2a43e 100644 --- a/test/public/style.css +++ b/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; } \ No newline at end of file diff --git a/test/views/tests.jade b/test/views/tests.jade index 6558860..83109f2 100644 --- a/test/views/tests.jade +++ b/test/views/tests.jade @@ -9,4 +9,5 @@ table#tests thead th node-canvas th target + th source tbody \ No newline at end of file