Skip to content
This repository was archived by the owner on Jul 6, 2021. It is now read-only.

Unit Tests #32

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3cca35f
0.3.9
noramass Jul 9, 2019
ff53713
add unit testing and coverage with karma
noramass Jul 9, 2019
c99d235
ignore conf files in code climate
noramass Jul 9, 2019
5ba386b
enable code coverage reporting in travis ci
noramass Jul 9, 2019
b96dcc5
add unit tests for classString and styleString
noramass Jul 9, 2019
8b814d9
add unit tests for membersToPrefixedAttributes
noramass Jul 9, 2019
c91bd2d
add unit tests for normalizeAttributes
noramass Jul 9, 2019
bd8456d
refactor render function h => element
noramass Jul 9, 2019
6dbbd39
add test stubs for tabbing, unit tests for keyOf and createElement
noramass Jul 9, 2019
ff73c5b
add unit tests for replaceAttributes
noramass Jul 9, 2019
864fb55
add unit tests for jsx and rendering
noramass Jul 9, 2019
7a08a8a
add unit tests for parsing
noramass Jul 9, 2019
2c8522c
typos
noramass Jul 9, 2019
7698406
add sourcemaps to istanbul loader output
noramass Jul 9, 2019
2064373
add unit tests for lock, locked and unlock
noramass Jul 9, 2019
338953f
fix merging of mixins, add unit tests for mixins
noramass Jul 10, 2019
02a75ac
bugfixes and tests for component class decorator
noramass Jul 10, 2019
06e61e4
fix injectables being instantiated on every acces, unit tests
noramass Jul 10, 2019
a8dc3c9
resolve construct hook not being called, unit tests
noramass Jul 12, 2019
30fdb2e
reduce complexity of mergeExtensions
noramass Jul 12, 2019
495e0eb
listen unit tests, render callbacks
noramass Jul 14, 2019
1516acf
define codeclimate similar code threshold
noramass Jul 14, 2019
d24f678
raise threshold by 5
noramass Jul 14, 2019
76bbc55
'remove' code duplication
noramass Jul 14, 2019
77ecfe7
revert duplication 'fix', raise duplication threshold
noramass Jul 14, 2019
1073baa
streamline imports
noramass Jul 14, 2019
066590c
add observedProperties hook to validate extension
noramass Jul 14, 2019
f9189fc
add unit tests for validate
noramass Jul 14, 2019
a035af1
formatting changes
noramass Jul 14, 2019
1346e7b
add observedProperties hook for watch extension, unit tests
noramass Jul 14, 2019
215994d
add unit tests for events
noramass Jul 14, 2019
a54471a
remove property restrictions from event properties
noramass Jul 14, 2019
ac53f68
unit tests for inherit, fix removing handlers from nonexistent parent
noramass Jul 14, 2019
b776650
add unit tests for Inject
noramass Jul 14, 2019
bbdc2f4
typos, unit tests for parent, model test stub
noramass Jul 14, 2019
9467207
fix property syncing to occur too many times or not at all, unit tests
noramass Jul 16, 2019
e6b1d17
optimize query login, query unit tests
noramass Jul 16, 2019
827aa56
remove log statements from parent decorator
noramass Jul 16, 2019
9f125c4
resolve formatting issue in query
noramass Jul 16, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ plugins:
enabled: true
nodesecurity:
enabled: true
checks:
similar-code:
threshold: 60
exclude_patterns:
- "dist/"
- "node_modules/"
Expand All @@ -16,3 +19,4 @@ exclude_patterns:
- "**.d.ts"
- "**/*.md"
- "**/*.config.*"
- "**/*.conf.*"
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ install:
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
# - ./cc-test-reporter before-build
- ./cc-test-reporter before-build

script:
- npm run test

#after_script:
# - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

before_deploy:
- npm shrinkwrap
Expand Down
15 changes: 15 additions & 0 deletions karma-ci.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

const conf = require("./karma.conf");

module.exports = function(config) {
conf(config);
config.set({
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,

// Concurrency level
// how many browser should be started simultaneous
concurrency: 1
});
};
111 changes: 111 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// Karma configuration
// Generated on Tue Jul 09 2019 03:33:15 GMT+0200 (GMT+02:00)
const path = require("path");
const webpackConfig = require("./webpack.config");

process.env.CHROME_BIN = require("puppeteer").executablePath();

delete webpackConfig.entry;

webpackConfig.module.rules.push({
test: /\.tsx?$/,
loader: 'istanbul-instrumenter-loader',
include: path.join(__dirname, 'src'),
options: {
esModules: true,
produceSourceMap: true
},
enforce: 'post',
exclude: /(node_modules|\.test\.tsx?$)/
});

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: [
{ pattern: 'test/index.ts', watch: false },
],


// list of files / patterns to exclude
exclude: [
'**.d.ts'
],

// Webpack Configuration
webpack: {
...webpackConfig,
stats: {
warnings: false
}
},

webpackMiddleware: {
noInfo: true
},


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'test/index.ts': ['webpack', 'sourcemap']
},

mime: {
"text/x-typescript": ["ts", "tsx"],
},

coverageIstanbulReporter: {
reports: ['text-summary', 'lcov'],
options: { esModules: true },
fixWebpackSourcePaths: true,
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'coverage-istanbul'],


// 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: ['ChromeHeadless'],


// 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
})
};
Loading