diff --git a/spec/karma.conf.js b/spec/karma.conf.js new file mode 100644 index 0000000000000000000000000000000000000000..e78fd7e7e1fde5e9bcdf3cd52747ad643c052827 --- /dev/null +++ b/spec/karma.conf.js @@ -0,0 +1,71 @@ +// Karma configuration +// Generated on Mon Aug 06 2018 12:37:42 GMT+0200 (CEST) + +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: [ + // 'src/**/*[Ss]pec.js' + 'test.js' + ], + + + // list of files / patterns to exclude + exclude: [ + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + 'test.js' : ['webpack'] + }, + + + // 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 + }) +} diff --git a/spec/support/jasmine.json b/spec/support/jasmine.json new file mode 100644 index 0000000000000000000000000000000000000000..370fc44641ff2b653bbc9a229ee38bc60a5afbb2 --- /dev/null +++ b/spec/support/jasmine.json @@ -0,0 +1,11 @@ +{ + "spec_dir": "spec", + "spec_files": [ + "**/*[sS]pec.js" + ], + "helpers": [ + "helpers/**/*.js" + ], + "stopSpecOnExpectationFailure": false, + "random": true +} diff --git a/spec/test.js b/spec/test.js new file mode 100644 index 0000000000000000000000000000000000000000..c319620aa6b0eeed5b5b95c4a5d0618aa94c5cd1 --- /dev/null +++ b/spec/test.js @@ -0,0 +1,5 @@ +/* required or reflect metadata error will be thrown */ +import 'reflect-metadata'; + +const testContext = require.context('../src',true,/\.spec.ts$/) +testContext.keys().map(testContext) \ No newline at end of file diff --git a/src/util/pipes/copyProperty.pipe.spec.js b/src/util/pipes/copyProperty.pipe.spec.js new file mode 100644 index 0000000000000000000000000000000000000000..d654153d7560448f4af8847557c5caae6c2cef35 --- /dev/null +++ b/src/util/pipes/copyProperty.pipe.spec.js @@ -0,0 +1,30 @@ +// import { CopyPropertyPipe } from './copyProperty.pipe' +// import {describe,it,expect} from 'jasmine' +import { TempClass } from './temp' + +describe('copyProperty.pipe works as expected', () => { + it('jasmine works', () => { + expect(1).toBe(1) + }) + // it('pipe should work', () => { + // const pipe = new CopyPropertyPipe() + // const array = [{ + // name : 'name1', + // key1 : 'value1' + // },{ + // name : 'name2', + // key1 : 'value2' + // }] + // const newItem = pipe.transform(array,'key1','key2') + // // expect(newItem).toContain({ + // // namem : 'name1', + // // key1 : 'value1', + // // key2 : 'value1' + // // }) + // expect(newItem[0]).toEqual({ + // name : 'name1', + // key1 : 'value1', + // key2 : 'value1' + // }) + // }) +}) \ No newline at end of file diff --git a/src/util/pipes/temp.ts b/src/util/pipes/temp.ts new file mode 100644 index 0000000000000000000000000000000000000000..560fd1b94c479e0d18490d82b6f55afddcc43094 --- /dev/null +++ b/src/util/pipes/temp.ts @@ -0,0 +1,3 @@ +export class TempClass{ + +} \ No newline at end of file