diff --git a/gulpfile.js b/gulpfile.js index da2fd6d81a..00a4e25288 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -434,8 +434,13 @@ gulp.task('test.js/ci', function (done) { gulp.task('test.dart/ci', function (done) { karma.start({configFile: __dirname + '/karma-dart.conf.js', singleRun: true, reporters: ['dots'], browsers: getBrowsersFromCLI()}, done); }); +gulp.task('test.transpiler.unittest', function (done) { + return gulp.src('tools/transpiler/unittest/**/*.js') + .pipe(jasmine()) +}); gulp.task('ci', function(done) { runSequence( + 'test.transpiler.unittest', 'test.js/ci', 'test.dart/ci' ); diff --git a/package.json b/package.json index 5f8b7f8c22..9805647c0a 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "node-uuid": "1.4.x" }, "devDependencies": { + "angular": "1.3.5", "bower": "^1.3.12", "canonical-path": "0.0.2", "del": "~1", @@ -43,15 +44,14 @@ "karma-cli": "^0.0.4", "karma-dart": "^0.2.8", "karma-jasmine": "^0.2.2", - "merge": "^1.2.0", - "angular": "1.3.5", - "minimatch": "^2.0.1", "lodash": "^2.4.1", - "sprintf-js": "1.0.*", - "q": "^1.0.1", + "merge": "^1.2.0", + "minimatch": "^2.0.1", + "minimist": "1.1.x", "protractor": "1.6.x", + "q": "^1.0.1", "run-sequence": "^0.3.6", - "through2": "^0.6.1", - "minimist": "1.1.x" + "sprintf-js": "1.0.*", + "through2": "^0.6.1" } } diff --git a/tools/transpiler/unittest/transpilertests.js b/tools/transpiler/unittest/transpilertests.js new file mode 100644 index 0000000000..4316dcc204 --- /dev/null +++ b/tools/transpiler/unittest/transpilertests.js @@ -0,0 +1,27 @@ +var compiler = require('../index'); + +// fixme: copied from top of gulpfile +var OPTIONS = { + sourceMaps: true, + annotations: true, // parse annotations + types: true, // parse types + script: false, // parse as a module + memberVariables: true, // parse class fields + outputLanguage: 'dart' +}; + +describe('transpile to dart', function(){ + + // https://github.com/angular/angular/issues/509 + it('should not interpolate inside old quotes', function(){ + var result = compiler.compile(OPTIONS, "test.js", + "var a = 1;" + + "var s1 = '${a}';" + + "var s2 = `${a}`;"); + expect(result.js).toBe("library test;\n" + + "var a = 1;\n" + + // FIXME: this should escape the interpolation with backslash to fix the issue + "var s1 = '${a}';\n" + + "var s2 = '''${a}''';\n"); + }) +});