Created
March 2, 2017 16:53
-
-
Save Turbo87/f77b3b74aded7c33bf5dc68c7319a0aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const broccoliTestHelper = require('broccoli-test-helper'); | |
const expect = require('chai').expect; | |
const EmberApp = require('../../../../lib/broccoli/ember-app'); | |
const MockCLI = require('../../../helpers/mock-cli'); | |
const Project = require('../../../../lib/models/project'); | |
const buildOutput = broccoliTestHelper.buildOutput; | |
const createTempDir = broccoliTestHelper.createTempDir; | |
describe('EmberApp.index()', function() { | |
let input; | |
beforeEach(function() { | |
return createTempDir().then(tempDir => (input = tempDir)); | |
}); | |
afterEach(function() { | |
return input.dispose(); | |
}); | |
function createApp(options) { | |
options = options || {}; | |
let pkg = { name: 'ember-app-test' }; | |
let cli = new MockCLI(); | |
let project = new Project(input.path(), pkg, cli.ui, cli); | |
return new EmberApp({ | |
project, | |
_ignoreMissingLoader: true, | |
}, options); | |
} | |
it('simple', function() { | |
input.write({ | |
'app': { | |
'index.html': 'foobar', | |
}, | |
'config': {}, | |
}); | |
let app = createApp(); | |
return buildOutput(app.index()).then(output => { | |
expect(output.read()).to.deep.equal({ | |
'index.html': 'foobar', | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment