Fix PouchType tests
This commit is contained in:
parent
c286ccbc9d
commit
1979836c38
@ -9,8 +9,9 @@
|
||||
"src"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "node ../../bin/runTests.js ./",
|
||||
"pre-commit": "npm run test"
|
||||
"test": "npm run build:test && mv dist/index.html ./.spec_runner.html && node ../../bin/runTests.js ./",
|
||||
"pre-commit": "npm run test",
|
||||
"build:test": "webpack --config webpack.test-config.js"
|
||||
},
|
||||
"author": "Timothy Farrell <tim@thecookiejar.me> (https://github.com/explorigin)",
|
||||
"license": "Apache-2.0",
|
||||
@ -18,6 +19,12 @@
|
||||
"frptools": "~3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"pouchdb": "~7.0.0"
|
||||
"html-webpack-plugin": "~3.2.0",
|
||||
"pouchdb": "~7.0.0",
|
||||
"pouchdb-find": "~7.0.0",
|
||||
"pouchdb-adapter-memory": "^7.0.0",
|
||||
"script-ext-html-webpack-plugin": "^2.0.1",
|
||||
"webpack": "~4.10.2",
|
||||
"webpack-cli": "~2.1.5"
|
||||
}
|
||||
}
|
||||
|
||||
15
packages/pouchtype/spec/index.html
Normal file
15
packages/pouchtype/spec/index.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Jasmine Spec Runner v3.1.0</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="/vendor/jasmine/jasmine_favicon.png">
|
||||
<link rel="stylesheet" href="/vendor/jasmine/jasmine.css">
|
||||
|
||||
<script src="/vendor/jasmine/jasmine.js"></script>
|
||||
<script src="/vendor/jasmine/jasmine-html.js"></script>
|
||||
<script defer src="/vendor/jasmine/boot.js"></script>
|
||||
</head><body></body>
|
||||
</html>
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
import { TypeHandler } from '../src/index.js';
|
||||
import PouchDB from 'pouchdb';
|
||||
import PouchDBFind from 'pouchdb-find';
|
||||
import memory from 'pouchdb-adapter-memory';
|
||||
|
||||
const PDB = PouchDB.plugin(find);
|
||||
const PDB = PouchDB.plugin(PouchDBFind).plugin(memory);
|
||||
|
||||
class ContactHandler extends TypeHandler {
|
||||
getUniqueID(doc) {
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
{
|
||||
"spec_dir": "spec",
|
||||
"spec_files": ["**/*[sS]pec.js"],
|
||||
"lib_files": [
|
||||
"node_modules/pouchdb/dist/pouchdb.js",
|
||||
"node_modules/pouchdb/dist/pouchdb.memory.js",
|
||||
"node_modules/pouchdb/dist/pouchdb.find.js"
|
||||
]
|
||||
}
|
||||
33
packages/pouchtype/webpack.test-config.js
Normal file
33
packages/pouchtype/webpack.test-config.js
Normal file
@ -0,0 +1,33 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname, './spec'),
|
||||
mode: 'development',
|
||||
entry: {
|
||||
livearray: './livearray.spec.js',
|
||||
typehandler: './typehandler.spec.js',
|
||||
watcher: './watcher.spec.js'
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, './dist'),
|
||||
filename: '[name].bundle.js',
|
||||
publicPath: '/packages/pouchtype/dist/'
|
||||
},
|
||||
devServer: {
|
||||
contentBase: path.join(__dirname, 'dist')
|
||||
},
|
||||
module: {},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({ __DEV__: true }),
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'index.html',
|
||||
inject: 'body'
|
||||
}),
|
||||
new ScriptExtHtmlWebpackPlugin({
|
||||
module: /.*/
|
||||
})
|
||||
]
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user