Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[failed test] babel-transpiled module considered invalid #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tests/fixtures/valid/EmberTranspiled/app.external.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
define('test-sourcemaps/app', ['exports', 'test-sourcemaps/resolver', 'ember-load-initializers', 'test-sourcemaps/config/environment'], function (exports, _resolver, _emberLoadInitializers, _environment) {
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
});


var App = Ember.Application.extend({
modulePrefix: _environment.default.modulePrefix,
podModulePrefix: _environment.default.podModulePrefix,
Resolver: _resolver.default
});

(0, _emberLoadInitializers.default)(App, _environment.default.modulePrefix);

exports.default = App;
});
1 change: 1 addition & 0 deletions tests/fixtures/valid/EmberTranspiled/app.external.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions tests/fixtures/valid/EmberTranspiled/app.inline.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions tests/fixtures/valid/EmberTranspiled/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Ember from 'ember';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

const App = Ember.Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
});

loadInitializers(App, config.modulePrefix);

export default App;
19 changes: 19 additions & 0 deletions tests/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,23 @@ tests['Valid Minifyified bundle with inline sourcemap should not throw'] = funct
}, 'Valid Minifyified inline sourcemap and inline sourceContent should not throw');
};

tests['Valid babel-transpiled module with external sourcemap should not throw'] = function () {
var mfDir = path.join(validDir, 'EmberTranspiled')
, transpiled = fs.readFileSync(path.join(mfDir, 'app.external.js')).toString()
, map = fs.readFileSync(path.join(mfDir, 'app.external.map')).toString();

assert.doesNotThrow(function () {
validate(transpiled, map);
}, 'Valid babel-transpiled module with external sourcemap should not throw');
};

tests['Valid babel-transpiled module with inline sourcemap should not throw'] = function () {
var mfDir = path.join(validDir, 'EmberTranspiled')
, transpiled = fs.readFileSync(path.join(mfDir, 'app.inline.js')).toString();

assert.doesNotThrow(function () {
validate(transpiled);
}, 'Valid babel-transpiled module with inline sourcemap should not throw');
};

module.exports = tests;