Skip to content

Commit

Permalink
start test
Browse files Browse the repository at this point in the history
  • Loading branch information
devyumao committed Jul 9, 2016
1 parent d923b96 commit b4252e6
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 11 deletions.
37 changes: 37 additions & 0 deletions config/webpack.test.js
@@ -0,0 +1,37 @@
var ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin;

var helper = require('./helper');

module.exports = {
debug: true,

context: helper.root('test'),

entry: {
'busy.spec': 'busy.spec.ts'
},

output: {
path: helper.root('test'),
filename: '[name].js'
},

resolve: {
extensions: ['', '.ts', '.js'],
root: helper.root('test'),
modulesDirectories: ['node_modules']
},

module: {
loaders: [
{
test: /\.ts$/,
loader: 'awesome-typescript'
}
]
},

plugins: [
new ForkCheckerPlugin()
]
};
16 changes: 5 additions & 11 deletions package.json
Expand Up @@ -6,7 +6,7 @@
"type": "git",
"url": "git+https://github.com/devyumao/angular2-busy.git"
},
"keyword": [
"keywords": [
"angular",
"angular2",
"busy",
Expand All @@ -28,7 +28,8 @@
"build:busy": "npm run build",
"watch:busy": "npm run watch",
"build:demo": "NODE_ENV=demo webpack --progress",
"watch:demo": "NODE_ENV=demo webpack-dev-server --inline --progress --profile --colors --watch --display-error-details --display-cached --content-base demo/asset"
"watch:demo": "NODE_ENV=demo webpack-dev-server --inline --progress --profile --colors --watch --display-error-details --display-cached --content-base demo/asset",
"test": "NODE_ENV=test webpack --inline --progress --colors --watch --content-base test"
},
"dependencies": {
"@angular/common": "^2.0.0-rc.4",
Expand All @@ -52,6 +53,7 @@
"extract-text-webpack-plugin": "^1.0.1",
"html-webpack-plugin": "^2.19.0",
"install": "^0.8.1",
"jasmine-core": "2.4.1",
"less": "^2.7.1",
"less-loader": "^2.2.3",
"postcss-loader": "^0.9.1",
Expand All @@ -62,13 +64,5 @@
"typings": "^0.8.1",
"webpack": "^1.12.15",
"webpack-dev-server": "^1.14.1"
},
"keywords": [
"angular",
"angular2",
"busy",
"loading",
"angular2-busy",
"ng2-busy"
]
}
}
54 changes: 54 additions & 0 deletions test/busy.spec.js
@@ -0,0 +1,54 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};

/******/ // The require function
/******/ function __webpack_require__(moduleId) {

/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;

/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };

/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ // Flag the module as loaded
/******/ module.loaded = true;

/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }


/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;

/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;

/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";

/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports) {

"use strict";
describe('BusyDirective', function () {
// forthcoming...
});


/***/ }
/******/ ]);
11 changes: 11 additions & 0 deletions test/busy.spec.ts
@@ -0,0 +1,11 @@
import {
it,
inject,
beforeEachProviders
} from '@angular/core/testing';

import {BusyDirective} from '..';

describe('BusyDirective', () => {
// forthcoming...
});
16 changes: 16 additions & 0 deletions test/index.html
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Angular 2 Tests</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="../node_modules/jasmine-core/lib/jasmine-core/jasmine.css" rel="stylesheet">
</head>
<body>
<script src="../node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
<script src="../node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
<script src="../node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
<script src="./busy.spec.js"></script>
</body>
</html>
3 changes: 3 additions & 0 deletions webpack.config.js
Expand Up @@ -8,6 +8,9 @@ switch (process.env.NODE_ENV) {
case 'demo':
module.exports = require('./config/webpack.demo');
break;
case 'test':
module.exports = require('./config/webpack.test');
break;
case 'busy':
default:
module.exports = require('./config/webpack.busy');
Expand Down

0 comments on commit b4252e6

Please sign in to comment.