OLD | NEW |
1 /// <reference path="../typings/chai/chai.d.ts"/> | 1 /// <reference path="../typings/chai/chai.d.ts"/> |
2 /// <reference path="../typings/mocha/mocha.d.ts"/> | 2 /// <reference path="../typings/mocha/mocha.d.ts"/> |
3 /// <reference path="../typings/source-map/source-map.d.ts"/> | 3 /// <reference path="../typings/source-map/source-map.d.ts"/> |
4 import chai = require('chai'); | 4 import chai = require('chai'); |
5 import main = require('../lib/main'); | 5 import main = require('../lib/main'); |
6 | 6 |
7 import {expectTranslate} from './test_support'; | 7 import {expectTranslate} from './test_support'; |
8 | 8 |
9 describe('main transpiler functionality', () => { | 9 describe('main transpiler functionality', () => { |
10 describe( | 10 describe( |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 chai.expect(() => transpiler.getOutputPath('/outside/b/c.js', '/x')) | 155 chai.expect(() => transpiler.getOutputPath('/outside/b/c.js', '/x')) |
156 .to.throw(/must be located under base/); | 156 .to.throw(/must be located under base/); |
157 }); | 157 }); |
158 it('defaults to writing to the same location', () => { | 158 it('defaults to writing to the same location', () => { |
159 let transpiler = new main.Transpiler({basePath: undefined}); | 159 let transpiler = new main.Transpiler({basePath: undefined}); |
160 chai.expect(transpiler.getOutputPath('/a/b/c.js', '/e')).to.equal('/a/b/c.
dart'); | 160 chai.expect(transpiler.getOutputPath('/a/b/c.js', '/e')).to.equal('/a/b/c.
dart'); |
161 chai.expect(transpiler.getOutputPath('b/c.js', '')).to.equal('b/c.dart'); | 161 chai.expect(transpiler.getOutputPath('b/c.js', '')).to.equal('b/c.dart'); |
162 }); | 162 }); |
163 it('translates .es6, .ts, and .js', () => { | 163 it('translates .es6, .ts, and .js', () => { |
164 let transpiler = new main.Transpiler({basePath: undefined}); | 164 let transpiler = new main.Transpiler({basePath: undefined}); |
165 ['a.js', 'a.ts', 'a.es6'].forEach( | 165 ['a.js', 'a.ts', 'a.es6'].forEach((n) => { |
166 (n) => { chai.expect(transpiler.getOutputPath(n, '')).to.equal('a.dart
'); }); | 166 chai.expect(transpiler.getOutputPath(n, '')).to.equal('a.dart'); |
| 167 }); |
167 }); | 168 }); |
168 }); | 169 }); |
169 }); | 170 }); |
OLD | NEW |