Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #119 from Ragg-/fix/core-test
Browse files Browse the repository at this point in the history
Fix core test
  • Loading branch information
Ragg committed Sep 6, 2017
2 parents 4922a53 + c4fda0b commit 7d65ad9
Show file tree
Hide file tree
Showing 11 changed files with 332 additions and 55 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -14,7 +14,9 @@ env:

install:
- npm i -g yarn
- yarn install -s
- yarn install -s --no-optional
# Remove problem optional module
- rm -rf ./node_modules/speaker

script:
- yarn test-front
Expand All @@ -27,5 +29,3 @@ addons:
packages:
- g++-4.8
- libfontconfig1-dev
# dependent by `av`
- libasound2-dev
13 changes: 7 additions & 6 deletions gulpfile.babel.js
Expand Up @@ -3,6 +3,7 @@ const $ = require("gulp-load-plugins")();
const rimraf = require("rimraf-promise");
const webpack = require("webpack");
const CleanWebpackPlugin = require('clean-webpack-plugin');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const builder = require('electron-builder')
const nib = require('nib')
const notifier = require('node-notifier')
Expand Down Expand Up @@ -111,7 +112,7 @@ export function compileRendererJs(done) {
sourceMapFilename: "map/[file].map",
path: paths.compiled.root,
},
devtool: "#source-map",
devtool: DELIR_ENV === 'dev' ? "#source-map" : 'none',
externals: [
(ctx, request, callback) => {
if (/^(?!\.\.?\/|\!\!?)/.test(request)) {
Expand Down Expand Up @@ -186,8 +187,8 @@ export function compileRendererJs(done) {
}
}),
...(DELIR_ENV === 'dev' ? [] : [
new webpack.optimize.AggressiveMergingPlugin,
new webpack.optimize.UglifyJsPlugin,
new webpack.optimize.AggressiveMergingPlugin(),
new UglifyJSPlugin(),
])
]
}, function(err, stats) {
Expand Down Expand Up @@ -224,7 +225,7 @@ export async function compilePlugins(done) {
path: paths.compiled.plugins,
libraryTarget: 'commonjs-module',
},
devtool: 'cheap-source-map',
devtool: DELIR_ENV === 'dev' ? "#source-map" : 'none',
externals: [
(ctx, request: string, callback) => {
if (request !== 'delir-core') return callback()
Expand Down Expand Up @@ -260,8 +261,8 @@ export async function compilePlugins(done) {
new CleanWebpackPlugin([''], {verbose: true, root: join(paths.compiled.root, 'plugins')}),
new webpack.DefinePlugin({__DEV__: JSON.stringify(DELIR_ENV === 'dev')}),
...(DELIR_ENV === 'dev' ? [] : [
new webpack.optimize.AggressiveMergingPlugin,
new webpack.optimize.UglifyJsPlugin,
new webpack.optimize.AggressiveMergingPlugin(),
new UglifyJSPlugin(),
])
]
}, function(err, stats) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -74,6 +74,7 @@
"ts-node": "3.3.0",
"tslint": "5.6.0",
"tslint-loader": "3.5.3",
"uglifyjs-webpack-plugin": "1.0.0-beta.2",
"webpack": "3.5.3"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions src/delir-core/fixtures/plugins/chromakey/index.js

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

14 changes: 14 additions & 0 deletions src/delir-core/fixtures/plugins/chromakey/package.json
@@ -0,0 +1,14 @@
{
"name": "@ragg/delir-posteffect-chromakey",
"version": "0.0.0",
"author": "Ragg (https://twitter.com/@_ragg_)",
"license": "MIT",
"main": "index.js",
"engines": {
"delir-core": "0.0.0-alpha.3"
},
"delir": {
"name": "クロマキー",
"type": "post-effect"
}
}
1 change: 1 addition & 0 deletions src/delir-core/fixtures/plugins/filler/index.js

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

1 change: 1 addition & 0 deletions src/delir-core/fixtures/plugins/the-world/index.js

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

14 changes: 14 additions & 0 deletions src/delir-core/fixtures/plugins/the-world/package.json
@@ -0,0 +1,14 @@
{
"name": "@ragg/delir-posteffect-the-world",
"version": "0.1.0",
"author": "Ragg (https://twitter.com/@_ragg_)",
"license": "MIT",
"main": "index.js",
"engines": {
"delir-core": "0.0.0-alpha.3"
},
"delir": {
"name": "The world",
"type": "post-effect"
}
}
4 changes: 2 additions & 2 deletions src/delir-core/src/__spec__/index-spec.ts
Expand Up @@ -65,8 +65,8 @@ describe('Check exportings', () => {
expect(Delir.Engine).to.be.an('object')
})

it('Delir.LayerPluginBase', () => {
expect(Delir.LayerPluginBase).to.be.an('function')
it('Delir.PostEffectBase', () => {
expect(Delir.PostEffectBase).to.be.an('function')
})

it('Delir.ProjectHelper', () => {
Expand Down
@@ -1,27 +1,15 @@
// @flow
import path from 'path'
import PluginRegistry from '../plugin-registry'
import * as path from 'path'
import FSPluginLoader from '../FSPluginLoader'

describe('PluginRegistry', () => {
it('exporting: PluginFeatures', () => {
expect(PluginRegistry.PluginFeatures).to.not.eql(null)
expect(PluginRegistry.PluginFeatures).to.be.an('object')
})

it('loading plugins', async () => {
// mock missing method in mocha
global.require = require
const r = new FSPluginLoader()
const result = await r.loadPackageDir(path.join(__dirname, '../../../fixtures/plugins'))

const r = new PluginRegistry()
const result = await r.loadPackageDir(path.join(__dirname, '../../src/plugins'))

expect(result).to.not.empty()
expect(result).to.have.key('packages')
expect(result).to.have.key('loaded')
expect(result).to.have.key('failed')

expect(result.packages).to.be.an('object')
expect(result.loaded).to.be.an('object')
expect(result.failed).to.be.an(Array)

delete global.require
})
})

0 comments on commit 7d65ad9

Please sign in to comment.