Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: README.md tasks/jade.js
- Loading branch information
Showing
30 changed files
with
929 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html><html lang="en"><head></head><body><div id="container"></div></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>test</h1><h2>include</h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>test</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html><html lang="en"><head></head><body><div id="container"></div><p>Hi</p></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>test</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>test</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>test</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
var grunt = require('grunt'); | ||
|
||
/* | ||
======== A Handy Little Nodeunit Reference ======== | ||
https://github.com/caolan/nodeunit | ||
Test methods: | ||
test.expect(numAssertions) | ||
test.done() | ||
Test assertions: | ||
test.ok(value, [message]) | ||
test.equal(actual, expected, [message]) | ||
test.notEqual(actual, expected, [message]) | ||
test.deepEqual(actual, expected, [message]) | ||
test.notDeepEqual(actual, expected, [message]) | ||
test.strictEqual(actual, expected, [message]) | ||
test.notStrictEqual(actual, expected, [message]) | ||
test.throws(block, [error], [message]) | ||
test.doesNotThrow(block, [error], [message]) | ||
test.ifError(value) | ||
*/ | ||
|
||
exports['jade-amd'] = function (test){ | ||
'use strict'; | ||
|
||
test.expect(2); | ||
|
||
var actual, expected; | ||
// Test the runtime output | ||
actual = grunt.file.read('tmp/jade-amd/runtime.js'); | ||
expected = grunt.file.read('test/fixtures/amd/runtime_expected.js'); | ||
test.equal(actual, expected, 'should generate an AMD module for the runtime'); | ||
// Test helloworld.jade output | ||
actual = grunt.file.read('tmp/jade-amd/helloworld.js'); | ||
expected = grunt.file.read('test/fixtures/amd/helloworld_expected.js'); | ||
test.equal(actual, expected, 'should generate an AMD module for the template'); | ||
|
||
test.done(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
var grunt = require('grunt'); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
// In Nodejs 0.8.0, existsSync moved from path -> fs. | ||
var existsSync = fs.existsSync || path.existsSync; | ||
|
||
/* | ||
======== A Handy Little Nodeunit Reference ======== | ||
https://github.com/caolan/nodeunit | ||
Test methods: | ||
test.expect(numAssertions) | ||
test.done() | ||
Test assertions: | ||
test.ok(value, [message]) | ||
test.equal(actual, expected, [message]) | ||
test.notEqual(actual, expected, [message]) | ||
test.deepEqual(actual, expected, [message]) | ||
test.notDeepEqual(actual, expected, [message]) | ||
test.strictEqual(actual, expected, [message]) | ||
test.notStrictEqual(actual, expected, [message]) | ||
test.throws(block, [error], [message]) | ||
test.doesNotThrow(block, [error], [message]) | ||
test.ifError(value) | ||
*/ | ||
|
||
exports['jade-custom_extension'] = function (test){ | ||
'use strict'; | ||
|
||
test.expect(2); | ||
|
||
var actual, expected, runtimeExists; | ||
// Test there is no runtime output | ||
runtimeExists = existsSync('tmp/jade-custom_extension/runtime.xml') || existsSync('tmp/jade-html/runtime.js'); | ||
test.equal(runtimeExists, false, 'should NOT generate a module for the runtime'); | ||
// Test helloworld.jade output | ||
actual = grunt.file.read('tmp/jade-custom_extension/helloworld.xml'); | ||
expected = grunt.file.read('test/fixtures/custom_extension/helloworld_expected.xml'); | ||
test.equal(actual, expected, 'should generate an XML file for the template'); | ||
|
||
test.done(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
var grunt = require('grunt'); | ||
|
||
/* | ||
======== A Handy Little Nodeunit Reference ======== | ||
https://github.com/caolan/nodeunit | ||
Test methods: | ||
test.expect(numAssertions) | ||
test.done() | ||
Test assertions: | ||
test.ok(value, [message]) | ||
test.equal(actual, expected, [message]) | ||
test.notEqual(actual, expected, [message]) | ||
test.deepEqual(actual, expected, [message]) | ||
test.notDeepEqual(actual, expected, [message]) | ||
test.strictEqual(actual, expected, [message]) | ||
test.notStrictEqual(actual, expected, [message]) | ||
test.throws(block, [error], [message]) | ||
test.doesNotThrow(block, [error], [message]) | ||
test.ifError(value) | ||
*/ | ||
|
||
exports['jade-debug'] = function (test){ | ||
'use strict'; | ||
|
||
test.expect(2); | ||
|
||
var actual, expected; | ||
// Test the runtime output | ||
actual = grunt.file.read('tmp/jade-debug/runtime.js'); | ||
expected = grunt.file.read('test/fixtures/debug/runtime_expected.js'); | ||
test.equal(actual, expected, 'should generate a global module for the runtime'); | ||
// Test helloworld.jade output | ||
actual = grunt.file.read('tmp/jade-debug/helloworld.js'); | ||
expected = grunt.file.read('test/fixtures/debug/helloworld_expected.js'); | ||
test.equal(actual, expected, 'should generate a global module (with debug) for the template'); | ||
|
||
test.done(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
define(['runtime'], function(jade){ | ||
return function anonymous(locals, attrs, escape, rethrow, merge) { | ||
attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge; | ||
var buf = []; | ||
with (locals || {}) { | ||
var interp; | ||
buf.push('<h1>Hello, tester!</h1>'); | ||
} | ||
return buf.join(""); | ||
}; | ||
}); |
Oops, something went wrong.