Sha256: ddb46063ef26e610736314c9219a6f4ea00d6d7e661a653bb156f43d81651307

Contents?: true

Size: 738 Bytes

Versions: 3

Compression:

Stored size: 738 Bytes

Contents

require 'test_helper'

class Es6TiltTest < ActiveSupport::TestCase
  test "truth" do
    assert_kind_of Module, Es6Tilt
  end

  test "transpile" do
    template = ES6Tilt::ES6Transformer.new('./test/dummy/app/assets/javascripts/test.es6')
    output = template.render
    expectation = '"use strict";

var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };

/**
 * Created by michaelarchibald on 3/25/15.
 */

var Person = function Person() {
    var args = arguments[0] === undefined ? "default" : arguments[0];

    _classCallCheck(this, Person);

    this.eat = "happy Meal";
};'
    assert_equal expectation, output
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
es6_tilt-0.0.3 test/es6_tilt_test.rb
es6_tilt-0.0.2 test/es6_tilt_test.rb
es6_tilt-0.0.1 test/es6_tilt_test.rb