-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
MaxGenash
committed
Aug 18, 2020
1 parent
930922f
commit c39c67b
Showing
11 changed files
with
260 additions
and
714 deletions.
There are no files selected for viewing
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ const Sinon = require('sinon'); | |
const Path = require('path'); | ||
const { promisify } = require('util'); | ||
const async = require('async'); | ||
const when = require('when'); | ||
const Lab = require('@hapi/lab'); | ||
const lab = exports.lab = Lab.script(); | ||
const describe = lab.describe; | ||
|
@@ -15,7 +14,6 @@ const expect = Code.expect; | |
const it = lab.it; | ||
const StencilBundle = require('./stencil-bundle'); | ||
const LangAssembler = require('./lang-assembler'); | ||
const jspm = require('jspm'); | ||
const themeSchema = Fs.readFileSync((Path.join(themePath, 'schema.json'))).toString(); | ||
|
||
describe('Stencil Bundle', () => { | ||
|
@@ -123,29 +121,6 @@ describe('Stencil Bundle', () => { | |
expect(error).to.equal('our_error'); | ||
}); | ||
|
||
it('should bundle JSPM assets', async () => { | ||
sandbox.stub(jspm, 'bundleSFX').returns(when()); | ||
|
||
const jspmBundleTask = Bundle.getJspmBundleTask(getThemeConfigStub().getRawConfig); | ||
const result = await promisify(jspmBundleTask.bind(Bundle))(); | ||
|
||
expect(result).to.equal(true); | ||
}); | ||
|
||
it('should fail to bundle JSPM assets', async () => { | ||
sandbox.stub(jspm, 'bundleSFX').returns(when.reject('SFX Bundle input error')); | ||
|
||
let error; | ||
try { | ||
const jspmBundleTask = Bundle.getJspmBundleTask(getThemeConfigStub().getRawConfig); | ||
await promisify(jspmBundleTask.bind(Bundle))(); | ||
} catch (err) { | ||
error = err; | ||
} | ||
|
||
expect(error).to.equal('SFX Bundle input error'); | ||
}); | ||
|
||
it('should generate a manifest of files.', async () => { | ||
const templates = await promisify(Bundle.assembleTemplatesTask.bind(Bundle))(); | ||
const manifest = await promisify(Bundle.generateManifest.bind(Bundle))({ templates }); | ||
|
@@ -170,15 +145,6 @@ describe('Stencil Bundle', () => { | |
|
||
function getThemeConfigStub() { | ||
const rawConfig = { | ||
jspm: { | ||
dev: { | ||
dep_location: 'assets/js/dependency-bundle.js', | ||
bootstrap: 'js/**/* - [js/**/*]', | ||
}, | ||
bootstrap: 'js/app', | ||
bundle_location: 'assets/js/bundle.js', | ||
jspm_packages_path: 'assets/jspm_packages', | ||
}, | ||
meta: { | ||
"author_name": "Emilio Esteves", | ||
"author_email": "[email protected]", | ||
|
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
Oops, something went wrong.