Sha256: 04682e58ff5b0b32faccedd43c4aa7d509f40fc7ef8aca2567208d370e4daf87
Contents?: true
Size: 896 Bytes
Versions: 22
Compression:
Stored size: 896 Bytes
Contents
require 'test_helper' require 'tilt' begin require 'tilt/typescript' class TypeScriptTemplateTest < Minitest::Test def setup @ts = "var x:number = 5" @js = /var x = 5;\s*/ end test "is registered for '.ts' files" do assert_equal Tilt::TypeScriptTemplate, Tilt['test.ts'] end test "compiles and evaluates the template on #render" do template = Tilt::TypeScriptTemplate.new { @ts } assert_match @js, template.render end test "supports source map" do template = Tilt::TypeScriptTemplate.new(inlineSourceMap: true) { @ts } assert_match /sourceMappingURL/, template.render end test "can be rendered more than once" do template = Tilt::TypeScriptTemplate.new { @ts } 3.times { assert_match @js, template.render } end end rescue LoadError => boom warn "Tilt::TypeScriptTemplate (disabled)" end
Version data entries
22 entries across 22 versions & 6 rubygems