Permalink
Browse files

Adding testing framework with jasmine, karma, npm, and travis

  • Loading branch information...
1 parent 2009d68 commit 3576ff972fcf55cb5805b42ebefd9f5bf566738e @JonHMChan committed Jul 19, 2016
Showing with 117 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +9 −0 .travis.yaml
  3. +69 −0 my.conf.js
  4. +31 −0 package.json
  5. +7 −0 tests/core.test.js
View
@@ -1,2 +1,3 @@
+node_modules
.DS_Store
.idea/
View
@@ -0,0 +1,9 @@
+language: node_js
+node_js:
+ - "0.10"
+script: node_modules/karma/bin/karma start my.conf.js --single-run
+before_install:
+ - export DISPLAY=:99.0
+ - sh -e /etc/init.d/xvfb start
+before_script:
+ - npm install
View
@@ -0,0 +1,69 @@
+// Karma configuration
+// Generated on Mon Jul 18 2016 21:00:32 GMT-0400 (EDT)
+
+module.exports = function(config) {
+ config.set({
+
+ // base path that will be used to resolve all patterns (eg. files, exclude)
+ basePath: '',
+
+
+ // frameworks to use
+ // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+ frameworks: ['jasmine'],
+
+
+ // list of files / patterns to load in the browser
+ files: [
+ 'dist/*.js, tests/*.js'
+ ],
+
+
+ // list of files to exclude
+ exclude: [
+ ],
+
+
+ // preprocess matching files before serving them to the browser
+ // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+ preprocessors: {
+ },
+
+
+ // test results reporter to use
+ // possible values: 'dots', 'progress'
+ // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+ reporters: ['progress'],
+
+
+ // web server port
+ port: 9876,
+
+
+ // enable / disable colors in the output (reporters and logs)
+ colors: true,
+
+
+ // level of logging
+ // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+ logLevel: config.LOG_INFO,
+
+
+ // enable / disable watching file and executing tests whenever any file changes
+ autoWatch: true,
+
+
+ // start these browsers
+ // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+ browsers: ['Chrome'],
+
+
+ // Continuous Integration mode
+ // if true, Karma captures browsers, runs the tests and exits
+ singleRun: false,
+
+ // Concurrency level
+ // how many browser should be started simultaneous
+ concurrency: Infinity
+ })
+}
View
@@ -0,0 +1,31 @@
+{
+ "name": "@descartes/core",
+ "version": "1.0.0",
+ "description": "A library for writing CSS in JavaScript",
+ "main": "dist/descartes.min.js",
+ "directories": {
+ "doc": "docs"
+ },
+ "dependencies": {
+ "babel-preset-es2015": "^6.3.13"
+ },
+ "devDependencies": {
+ "jasmine-core": "^2.4.1",
+ "karma": "^1.1.1",
+ "karma-chrome-launcher": "^1.0.1",
+ "karma-jasmine": "^1.0.2"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/JonHMChan/descartes.git"
+ },
+ "author": "Jon H.M. Chan (me@jonhmchan.com)",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/JonHMChan/descartes/issues"
+ },
+ "homepage": "https://github.com/JonHMChan/descartes"
+}
View
@@ -0,0 +1,7 @@
+describe('Core', function() {
+ var d = Descartes({})
+
+ it('Empty style tree should contain no mapping', function() {
+ expect(d.mapping).toBe({});
+ });
+});

0 comments on commit 3576ff9

Please sign in to comment.