Преглед на файлове

Basic testing implemented with Tape

Artur Paikin преди 9 години
родител
ревизия
5f8ce0c2be
променени са 3 файла, в които са добавени 18 реда и са изтрити 1 реда
  1. 3 1
      package.json
  2. 1 0
      src/core/Core.js
  3. 14 0
      test/core.spec.js

+ 3 - 1
package.json

@@ -25,7 +25,8 @@
     "web:install": "cd website && rm -rf node_modules/hexo-renderer-uppyexamples && npm install",
     "web:preview": "cd website && ./node_modules/.bin/hexo server --debug",
     "web": "npm run web:install && npm run web:clean && npm run web:build && npm run web:preview",
-    "docs": "cd website && node documentation.js"
+    "docs": "cd website && node documentation.js",
+    "start": "npm run build && npm run web"
   },
   "repository": {
     "type": "git",
@@ -51,6 +52,7 @@
     "node-sass": "^3.4.2",
     "nodemon": "^1.8.1",
     "phantomjs": "^1.9.18",
+    "tape": "^4.4.0",
     "watchify": "^3.6.1",
     "zuul": "^3.7.2"
   },

+ 1 - 0
src/core/Core.js

@@ -6,6 +6,7 @@ import Utils from '../core/Utils';
 */
 export default class Core {
   constructor(opts) {
+
     // Dictates in what order different plugin types are ran:
     this.types = [ 'presetter', 'selecter', 'uploader' ];
 

+ 14 - 0
test/core.spec.js

@@ -0,0 +1,14 @@
+var test = require('tape');
+var Core = require('../src/core/index.js');
+
+const core = new Core();
+
+test('core object', function (t) {
+  t.equal(typeof core, 'object', 'new Core() should return an object');
+  t.end();
+});
+
+test('core type', function (t) {
+  t.equal(core.type, 'core', 'core.type should equal core');
+  t.end();
+});