mirror of https://github.com/abpframework/abp.git
96 changed files with 383 additions and 1201 deletions
@ -0,0 +1,20 @@ |
|||||
|
using Autofac; |
||||
|
using Volo.Abp.Autofac; |
||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
|
||||
|
namespace Microsoft.Extensions.Hosting |
||||
|
{ |
||||
|
public static class AbpAutofacHostBuilderExtensions |
||||
|
{ |
||||
|
public static IHostBuilder UseAutofac(this IHostBuilder hostBuilder) |
||||
|
{ |
||||
|
var containerBuilder = new ContainerBuilder(); |
||||
|
|
||||
|
return hostBuilder.ConfigureServices((_, services) => |
||||
|
{ |
||||
|
services.AddObjectAccessor(containerBuilder); |
||||
|
}) |
||||
|
.UseServiceProviderFactory(new AbpAutofacServiceProviderFactory(containerBuilder)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,30 +0,0 @@ |
|||||
// @ts-check
|
|
||||
// Protractor configuration file, see link for more information
|
|
||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
|
||||
|
|
||||
const { SpecReporter } = require('jasmine-spec-reporter'); |
|
||||
|
|
||||
/** |
|
||||
* @type { import("protractor").Config } |
|
||||
*/ |
|
||||
exports.config = { |
|
||||
allScriptsTimeout: 11000, |
|
||||
specs: ['./src/**/*.e2e-spec.ts'], |
|
||||
capabilities: { |
|
||||
browserName: 'chrome', |
|
||||
}, |
|
||||
directConnect: true, |
|
||||
baseUrl: 'http://localhost:4200/', |
|
||||
framework: 'jasmine', |
|
||||
jasmineNodeOpts: { |
|
||||
showColors: true, |
|
||||
defaultTimeoutInterval: 30000, |
|
||||
print: function() {}, |
|
||||
}, |
|
||||
onPrepare() { |
|
||||
require('ts-node').register({ |
|
||||
project: require('path').join(__dirname, './tsconfig.json'), |
|
||||
}); |
|
||||
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); |
|
||||
}, |
|
||||
}; |
|
||||
@ -1,28 +0,0 @@ |
|||||
import { AppPage } from './app.po'; |
|
||||
import { browser, logging } from 'protractor'; |
|
||||
|
|
||||
describe('workspace-project App', () => { |
|
||||
let page: AppPage; |
|
||||
|
|
||||
beforeEach(() => { |
|
||||
page = new AppPage(); |
|
||||
}); |
|
||||
|
|
||||
it('should display welcome message', () => { |
|
||||
page.navigateTo(); |
|
||||
expect(page.getTitleText()).toEqual('dev-app app is running!'); |
|
||||
}); |
|
||||
|
|
||||
afterEach(async () => { |
|
||||
// Assert that there are no errors emitted from the browser
|
|
||||
const logs = await browser |
|
||||
.manage() |
|
||||
.logs() |
|
||||
.get(logging.Type.BROWSER); |
|
||||
expect(logs).not.toContain( |
|
||||
jasmine.objectContaining({ |
|
||||
level: logging.Level.SEVERE, |
|
||||
} as logging.Entry), |
|
||||
); |
|
||||
}); |
|
||||
}); |
|
||||
@ -1,11 +0,0 @@ |
|||||
import { browser, by, element } from 'protractor'; |
|
||||
|
|
||||
export class AppPage { |
|
||||
navigateTo() { |
|
||||
return browser.get(browser.baseUrl) as Promise<any>; |
|
||||
} |
|
||||
|
|
||||
getTitleText() { |
|
||||
return element(by.css('app-root .content span')).getText() as Promise<string>; |
|
||||
} |
|
||||
} |
|
||||
@ -1,9 +0,0 @@ |
|||||
{ |
|
||||
"extends": "../../../tsconfig.json", |
|
||||
"compilerOptions": { |
|
||||
"outDir": "../../../out-tsc/e2e", |
|
||||
"module": "commonjs", |
|
||||
"target": "es5", |
|
||||
"types": ["jasmine", "jasminewd2", "node"] |
|
||||
} |
|
||||
} |
|
||||
@ -1,32 +0,0 @@ |
|||||
// Karma configuration file, see link for more information
|
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||
|
|
||||
module.exports = function(config) { |
|
||||
config.set({ |
|
||||
basePath: '', |
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
||||
plugins: [ |
|
||||
require('karma-jasmine'), |
|
||||
require('karma-chrome-launcher'), |
|
||||
require('karma-jasmine-html-reporter'), |
|
||||
require('karma-coverage-istanbul-reporter'), |
|
||||
require('@angular-devkit/build-angular/plugins/karma'), |
|
||||
], |
|
||||
client: { |
|
||||
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
|
||||
}, |
|
||||
coverageIstanbulReporter: { |
|
||||
dir: require('path').join(__dirname, '../../coverage/dev-app'), |
|
||||
reports: ['html', 'lcovonly', 'text-summary'], |
|
||||
fixWebpackSourcePaths: true, |
|
||||
}, |
|
||||
reporters: ['progress', 'kjhtml'], |
|
||||
port: 9876, |
|
||||
colors: true, |
|
||||
logLevel: config.LOG_INFO, |
|
||||
autoWatch: true, |
|
||||
browsers: ['Chrome'], |
|
||||
singleRun: false, |
|
||||
restartOnFileChange: true, |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,14 +0,0 @@ |
|||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||
|
|
||||
import 'zone.js/dist/zone-testing'; |
|
||||
import { getTestBed } from '@angular/core/testing'; |
|
||||
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; |
|
||||
|
|
||||
declare const require: any; |
|
||||
|
|
||||
// First, initialize the Angular testing environment.
|
|
||||
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); |
|
||||
// Then we find all the tests.
|
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
|
||||
// And load the modules.
|
|
||||
context.keys().map(context); |
|
||||
@ -0,0 +1,19 @@ |
|||||
|
module.exports = { |
||||
|
globals: { |
||||
|
'ts-jest': { |
||||
|
allowSyntheticDefaultImports: true, |
||||
|
}, |
||||
|
}, |
||||
|
transform: { |
||||
|
'^.+\\.(ts|js|html)$': 'ts-jest', |
||||
|
}, |
||||
|
moduleFileExtensions: ['ts', 'js', 'html'], |
||||
|
coverageDirectory: '<rootDir>/coverage', |
||||
|
coverageReporters: ['html'], |
||||
|
preset: 'jest-preset-angular', |
||||
|
setupFilesAfterEnv: ['<rootDir>/test-setup.ts'], |
||||
|
snapshotSerializers: [ |
||||
|
'jest-preset-angular/AngularSnapshotSerializer.js', |
||||
|
'jest-preset-angular/HTMLCommentSerializer.js', |
||||
|
], |
||||
|
}; |
||||
@ -1,32 +0,0 @@ |
|||||
// Karma configuration file, see link for more information
|
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||
|
|
||||
module.exports = function (config) { |
|
||||
config.set({ |
|
||||
basePath: '', |
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
||||
plugins: [ |
|
||||
require('karma-jasmine'), |
|
||||
require('karma-chrome-launcher'), |
|
||||
require('karma-jasmine-html-reporter'), |
|
||||
require('karma-coverage-istanbul-reporter'), |
|
||||
require('@angular-devkit/build-angular/plugins/karma') |
|
||||
], |
|
||||
client: { |
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
||||
}, |
|
||||
coverageIstanbulReporter: { |
|
||||
dir: require('path').join(__dirname, '../../coverage/account-config'), |
|
||||
reports: ['html', 'lcovonly', 'text-summary'], |
|
||||
fixWebpackSourcePaths: true |
|
||||
}, |
|
||||
reporters: ['progress', 'kjhtml'], |
|
||||
port: 9876, |
|
||||
colors: true, |
|
||||
logLevel: config.LOG_INFO, |
|
||||
autoWatch: true, |
|
||||
browsers: ['Chrome'], |
|
||||
singleRun: false, |
|
||||
restartOnFileChange: true |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,21 +0,0 @@ |
|||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||
|
|
||||
import 'zone.js/dist/zone'; |
|
||||
import 'zone.js/dist/zone-testing'; |
|
||||
import { getTestBed } from '@angular/core/testing'; |
|
||||
import { |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting |
|
||||
} from '@angular/platform-browser-dynamic/testing'; |
|
||||
|
|
||||
declare const require: any; |
|
||||
|
|
||||
// First, initialize the Angular testing environment.
|
|
||||
getTestBed().initTestEnvironment( |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting() |
|
||||
); |
|
||||
// Then we find all the tests.
|
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
|
||||
// And load the modules.
|
|
||||
context.keys().map(context); |
|
||||
@ -1,32 +0,0 @@ |
|||||
// Karma configuration file, see link for more information
|
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||
|
|
||||
module.exports = function (config) { |
|
||||
config.set({ |
|
||||
basePath: '', |
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
||||
plugins: [ |
|
||||
require('karma-jasmine'), |
|
||||
require('karma-chrome-launcher'), |
|
||||
require('karma-jasmine-html-reporter'), |
|
||||
require('karma-coverage-istanbul-reporter'), |
|
||||
require('@angular-devkit/build-angular/plugins/karma') |
|
||||
], |
|
||||
client: { |
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
||||
}, |
|
||||
coverageIstanbulReporter: { |
|
||||
dir: require('path').join(__dirname, '../../coverage/account'), |
|
||||
reports: ['html', 'lcovonly'], |
|
||||
fixWebpackSourcePaths: true |
|
||||
}, |
|
||||
reporters: ['progress', 'kjhtml'], |
|
||||
port: 9876, |
|
||||
colors: true, |
|
||||
logLevel: config.LOG_INFO, |
|
||||
autoWatch: true, |
|
||||
browsers: ['Chrome'], |
|
||||
singleRun: false, |
|
||||
restartOnFileChange: true |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,21 +0,0 @@ |
|||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||
|
|
||||
import 'zone.js/dist/zone'; |
|
||||
import 'zone.js/dist/zone-testing'; |
|
||||
import { getTestBed } from '@angular/core/testing'; |
|
||||
import { |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting |
|
||||
} from '@angular/platform-browser-dynamic/testing'; |
|
||||
|
|
||||
declare const require: any; |
|
||||
|
|
||||
// First, initialize the Angular testing environment.
|
|
||||
getTestBed().initTestEnvironment( |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting() |
|
||||
); |
|
||||
// Then we find all the tests.
|
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
|
||||
// And load the modules.
|
|
||||
context.keys().map(context); |
|
||||
@ -0,0 +1,10 @@ |
|||||
|
const { pathsToModuleNameMapper } = require('ts-jest/utils'); |
||||
|
const { compilerOptions } = require('./tsconfig.spec'); |
||||
|
const jestConfig = require('../../jest.config'); |
||||
|
|
||||
|
module.exports = { |
||||
|
...jestConfig, |
||||
|
name: 'core', |
||||
|
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths /*, { prefix: '<rootDir>/' } */), |
||||
|
'ts-jest': { allowSyntheticDefaultImports: true }, |
||||
|
}; |
||||
@ -1,32 +0,0 @@ |
|||||
// Karma configuration file, see link for more information
|
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||
|
|
||||
module.exports = function (config) { |
|
||||
config.set({ |
|
||||
basePath: '', |
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
||||
plugins: [ |
|
||||
require('karma-jasmine'), |
|
||||
require('karma-chrome-launcher'), |
|
||||
require('karma-jasmine-html-reporter'), |
|
||||
require('karma-coverage-istanbul-reporter'), |
|
||||
require('@angular-devkit/build-angular/plugins/karma') |
|
||||
], |
|
||||
client: { |
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
||||
}, |
|
||||
coverageIstanbulReporter: { |
|
||||
dir: require('path').join(__dirname, '../../coverage/core'), |
|
||||
reports: ['html', 'lcovonly'], |
|
||||
fixWebpackSourcePaths: true |
|
||||
}, |
|
||||
reporters: ['progress', 'kjhtml'], |
|
||||
port: 9876, |
|
||||
colors: true, |
|
||||
logLevel: config.LOG_INFO, |
|
||||
autoWatch: true, |
|
||||
browsers: ['Chrome'], |
|
||||
singleRun: false, |
|
||||
restartOnFileChange: true |
|
||||
}); |
|
||||
}; |
|
||||
@ -0,0 +1,95 @@ |
|||||
|
import { createHttpFactory, HttpMethod, SpectatorHttp, SpyObject } from '@ngneat/spectator/jest'; |
||||
|
import { Store } from '@ngxs/store'; |
||||
|
import { Subscription, timer, interval, throwError, of } from 'rxjs'; |
||||
|
import { mapTo, catchError } from 'rxjs/operators'; |
||||
|
import { RestService } from '../services/rest.service'; |
||||
|
import { Rest } from '../models'; |
||||
|
import { RestOccurError } from '../actions'; |
||||
|
|
||||
|
describe('HttpClient testing', () => { |
||||
|
let spectator: SpectatorHttp<RestService>; |
||||
|
let store: SpyObject<Store>; |
||||
|
const api = 'https://abp.io'; |
||||
|
|
||||
|
const createHttp = createHttpFactory({ dataService: RestService, mocks: [Store] }); |
||||
|
|
||||
|
beforeEach(() => { |
||||
|
spectator = createHttp(); |
||||
|
store = spectator.get(Store); |
||||
|
store.selectSnapshot.andReturn(api); |
||||
|
}); |
||||
|
|
||||
|
test('should send a GET request with params', () => { |
||||
|
spectator.service.request({ method: HttpMethod.GET, url: '/test', params: { id: 1 } }).subscribe(); |
||||
|
spectator.expectOne(api + '/test?id=1', HttpMethod.GET); |
||||
|
}); |
||||
|
|
||||
|
test('should send a POST request with body', () => { |
||||
|
spectator.service.request({ method: HttpMethod.POST, url: '/test', body: { id: 1 } }).subscribe(); |
||||
|
const req = spectator.expectOne(api + '/test', HttpMethod.POST); |
||||
|
expect(req.request.body['id']).toEqual(1); |
||||
|
}); |
||||
|
|
||||
|
test('should use the specific api', () => { |
||||
|
spectator.service.request({ method: HttpMethod.GET, url: '/test' }, null, 'http://test.api').subscribe(); |
||||
|
spectator.expectOne('http://test.api' + '/test', HttpMethod.GET); |
||||
|
}); |
||||
|
|
||||
|
test('should close the subscriber when observe equal to body', done => { |
||||
|
jest.spyOn(spectator.httpClient, 'request').mockReturnValue(interval(50)); |
||||
|
|
||||
|
const subscriber: Subscription = spectator.service |
||||
|
.request({ method: HttpMethod.GET, url: '/test' }, { observe: Rest.Observe.Body }) |
||||
|
.subscribe(); |
||||
|
|
||||
|
timer(51).subscribe(() => { |
||||
|
expect(subscriber.closed).toBe(true); |
||||
|
done(); |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
test('should open the subscriber when observe not equal to body', done => { |
||||
|
jest.spyOn(spectator.httpClient, 'request').mockReturnValue(interval(50)); |
||||
|
|
||||
|
const subscriber: Subscription = spectator.service |
||||
|
.request({ method: HttpMethod.GET, url: '/test' }, { observe: Rest.Observe.Events }) |
||||
|
.subscribe(); |
||||
|
|
||||
|
timer(51).subscribe(() => { |
||||
|
expect(subscriber.closed).toBe(false); |
||||
|
done(); |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
test('should handle the error', () => { |
||||
|
jest.spyOn(spectator.httpClient, 'request').mockReturnValue(throwError('An error')); |
||||
|
const spy = jest.spyOn(store, 'dispatch'); |
||||
|
|
||||
|
spectator.service |
||||
|
.request({ method: HttpMethod.GET, url: '/test' }, { observe: Rest.Observe.Events }) |
||||
|
.pipe( |
||||
|
catchError(err => { |
||||
|
expect(err).toBeTruthy(); |
||||
|
expect(spy.mock.calls[0][0] instanceof RestOccurError).toBe(true); |
||||
|
return of(null); |
||||
|
}), |
||||
|
) |
||||
|
.subscribe(); |
||||
|
}); |
||||
|
|
||||
|
test('should not handle the error when skipHandleError is true', () => { |
||||
|
jest.spyOn(spectator.httpClient, 'request').mockReturnValue(throwError('An error')); |
||||
|
const spy = jest.spyOn(store, 'dispatch'); |
||||
|
|
||||
|
spectator.service |
||||
|
.request({ method: HttpMethod.GET, url: '/test' }, { observe: Rest.Observe.Events, skipHandleError: true }) |
||||
|
.pipe( |
||||
|
catchError(err => { |
||||
|
expect(err).toBeTruthy(); |
||||
|
expect(spy.mock.calls).toHaveLength(0); |
||||
|
return of(null); |
||||
|
}), |
||||
|
) |
||||
|
.subscribe(); |
||||
|
}); |
||||
|
}); |
||||
@ -1,21 +0,0 @@ |
|||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||
|
|
||||
import 'zone.js/dist/zone'; |
|
||||
import 'zone.js/dist/zone-testing'; |
|
||||
import { getTestBed } from '@angular/core/testing'; |
|
||||
import { |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting |
|
||||
} from '@angular/platform-browser-dynamic/testing'; |
|
||||
|
|
||||
declare const require: any; |
|
||||
|
|
||||
// First, initialize the Angular testing environment.
|
|
||||
getTestBed().initTestEnvironment( |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting() |
|
||||
); |
|
||||
// Then we find all the tests.
|
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
|
||||
// And load the modules.
|
|
||||
context.keys().map(context); |
|
||||
@ -1,13 +1,14 @@ |
|||||
{ |
{ |
||||
"extends": "../../tsconfig.json", |
"extends": "../../tsconfig.json", |
||||
"compilerOptions": { |
"compilerOptions": { |
||||
"outDir": "../../out-tsc/spec", |
"emitDecoratorMetadata": true, |
||||
"types": ["jasmine", "node"], |
"esModuleInterop": true, |
||||
|
"outDir": "../../dist/out-tsc", |
||||
|
"module": "commonjs", |
||||
|
"types": ["jest", "node"], |
||||
"paths": { |
"paths": { |
||||
"@abp/ng.core": ["packages/core/src/public-api.ts"], |
|
||||
"@abp/ng.core/*": ["packages/core/src/lib/*"] |
"@abp/ng.core/*": ["packages/core/src/lib/*"] |
||||
} |
} |
||||
}, |
}, |
||||
"files": ["src/test.ts"], |
|
||||
"include": ["**/*.spec.ts", "**/*.d.ts"] |
"include": ["**/*.spec.ts", "**/*.d.ts"] |
||||
} |
} |
||||
|
|||||
@ -1,32 +0,0 @@ |
|||||
// Karma configuration file, see link for more information
|
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||
|
|
||||
module.exports = function (config) { |
|
||||
config.set({ |
|
||||
basePath: '', |
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
||||
plugins: [ |
|
||||
require('karma-jasmine'), |
|
||||
require('karma-chrome-launcher'), |
|
||||
require('karma-jasmine-html-reporter'), |
|
||||
require('karma-coverage-istanbul-reporter'), |
|
||||
require('@angular-devkit/build-angular/plugins/karma') |
|
||||
], |
|
||||
client: { |
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
||||
}, |
|
||||
coverageIstanbulReporter: { |
|
||||
dir: require('path').join(__dirname, '../../coverage/feature-management'), |
|
||||
reports: ['html', 'lcovonly', 'text-summary'], |
|
||||
fixWebpackSourcePaths: true |
|
||||
}, |
|
||||
reporters: ['progress', 'kjhtml'], |
|
||||
port: 9876, |
|
||||
colors: true, |
|
||||
logLevel: config.LOG_INFO, |
|
||||
autoWatch: true, |
|
||||
browsers: ['Chrome'], |
|
||||
singleRun: false, |
|
||||
restartOnFileChange: true |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,21 +0,0 @@ |
|||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||
|
|
||||
import 'zone.js/dist/zone'; |
|
||||
import 'zone.js/dist/zone-testing'; |
|
||||
import { getTestBed } from '@angular/core/testing'; |
|
||||
import { |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting |
|
||||
} from '@angular/platform-browser-dynamic/testing'; |
|
||||
|
|
||||
declare const require: any; |
|
||||
|
|
||||
// First, initialize the Angular testing environment.
|
|
||||
getTestBed().initTestEnvironment( |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting() |
|
||||
); |
|
||||
// Then we find all the tests.
|
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
|
||||
// And load the modules.
|
|
||||
context.keys().map(context); |
|
||||
@ -1,32 +0,0 @@ |
|||||
// Karma configuration file, see link for more information
|
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||
|
|
||||
module.exports = function (config) { |
|
||||
config.set({ |
|
||||
basePath: '', |
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
||||
plugins: [ |
|
||||
require('karma-jasmine'), |
|
||||
require('karma-chrome-launcher'), |
|
||||
require('karma-jasmine-html-reporter'), |
|
||||
require('karma-coverage-istanbul-reporter'), |
|
||||
require('@angular-devkit/build-angular/plugins/karma') |
|
||||
], |
|
||||
client: { |
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
||||
}, |
|
||||
coverageIstanbulReporter: { |
|
||||
dir: require('path').join(__dirname, '../../coverage/identity-config'), |
|
||||
reports: ['html', 'lcovonly', 'text-summary'], |
|
||||
fixWebpackSourcePaths: true |
|
||||
}, |
|
||||
reporters: ['progress', 'kjhtml'], |
|
||||
port: 9876, |
|
||||
colors: true, |
|
||||
logLevel: config.LOG_INFO, |
|
||||
autoWatch: true, |
|
||||
browsers: ['Chrome'], |
|
||||
singleRun: false, |
|
||||
restartOnFileChange: true |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,21 +0,0 @@ |
|||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||
|
|
||||
import 'zone.js/dist/zone'; |
|
||||
import 'zone.js/dist/zone-testing'; |
|
||||
import { getTestBed } from '@angular/core/testing'; |
|
||||
import { |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting |
|
||||
} from '@angular/platform-browser-dynamic/testing'; |
|
||||
|
|
||||
declare const require: any; |
|
||||
|
|
||||
// First, initialize the Angular testing environment.
|
|
||||
getTestBed().initTestEnvironment( |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting() |
|
||||
); |
|
||||
// Then we find all the tests.
|
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
|
||||
// And load the modules.
|
|
||||
context.keys().map(context); |
|
||||
@ -1,32 +0,0 @@ |
|||||
// Karma configuration file, see link for more information
|
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||
|
|
||||
module.exports = function (config) { |
|
||||
config.set({ |
|
||||
basePath: '', |
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
||||
plugins: [ |
|
||||
require('karma-jasmine'), |
|
||||
require('karma-chrome-launcher'), |
|
||||
require('karma-jasmine-html-reporter'), |
|
||||
require('karma-coverage-istanbul-reporter'), |
|
||||
require('@angular-devkit/build-angular/plugins/karma') |
|
||||
], |
|
||||
client: { |
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
||||
}, |
|
||||
coverageIstanbulReporter: { |
|
||||
dir: require('path').join(__dirname, '../../coverage/identity'), |
|
||||
reports: ['html', 'lcovonly'], |
|
||||
fixWebpackSourcePaths: true |
|
||||
}, |
|
||||
reporters: ['progress', 'kjhtml'], |
|
||||
port: 9876, |
|
||||
colors: true, |
|
||||
logLevel: config.LOG_INFO, |
|
||||
autoWatch: true, |
|
||||
browsers: ['Chrome'], |
|
||||
singleRun: false, |
|
||||
restartOnFileChange: true |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,21 +0,0 @@ |
|||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||
|
|
||||
import 'zone.js/dist/zone'; |
|
||||
import 'zone.js/dist/zone-testing'; |
|
||||
import { getTestBed } from '@angular/core/testing'; |
|
||||
import { |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting |
|
||||
} from '@angular/platform-browser-dynamic/testing'; |
|
||||
|
|
||||
declare const require: any; |
|
||||
|
|
||||
// First, initialize the Angular testing environment.
|
|
||||
getTestBed().initTestEnvironment( |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting() |
|
||||
); |
|
||||
// Then we find all the tests.
|
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
|
||||
// And load the modules.
|
|
||||
context.keys().map(context); |
|
||||
@ -1,32 +0,0 @@ |
|||||
// Karma configuration file, see link for more information
|
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||
|
|
||||
module.exports = function (config) { |
|
||||
config.set({ |
|
||||
basePath: '', |
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
||||
plugins: [ |
|
||||
require('karma-jasmine'), |
|
||||
require('karma-chrome-launcher'), |
|
||||
require('karma-jasmine-html-reporter'), |
|
||||
require('karma-coverage-istanbul-reporter'), |
|
||||
require('@angular-devkit/build-angular/plugins/karma') |
|
||||
], |
|
||||
client: { |
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
||||
}, |
|
||||
coverageIstanbulReporter: { |
|
||||
dir: require('path').join(__dirname, '../../coverage/permission-management'), |
|
||||
reports: ['html', 'lcovonly'], |
|
||||
fixWebpackSourcePaths: true |
|
||||
}, |
|
||||
reporters: ['progress', 'kjhtml'], |
|
||||
port: 9876, |
|
||||
colors: true, |
|
||||
logLevel: config.LOG_INFO, |
|
||||
autoWatch: true, |
|
||||
browsers: ['Chrome'], |
|
||||
singleRun: false, |
|
||||
restartOnFileChange: true |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,21 +0,0 @@ |
|||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||
|
|
||||
import 'zone.js/dist/zone'; |
|
||||
import 'zone.js/dist/zone-testing'; |
|
||||
import { getTestBed } from '@angular/core/testing'; |
|
||||
import { |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting |
|
||||
} from '@angular/platform-browser-dynamic/testing'; |
|
||||
|
|
||||
declare const require: any; |
|
||||
|
|
||||
// First, initialize the Angular testing environment.
|
|
||||
getTestBed().initTestEnvironment( |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting() |
|
||||
); |
|
||||
// Then we find all the tests.
|
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
|
||||
// And load the modules.
|
|
||||
context.keys().map(context); |
|
||||
@ -1,32 +0,0 @@ |
|||||
// Karma configuration file, see link for more information
|
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||
|
|
||||
module.exports = function (config) { |
|
||||
config.set({ |
|
||||
basePath: '', |
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
||||
plugins: [ |
|
||||
require('karma-jasmine'), |
|
||||
require('karma-chrome-launcher'), |
|
||||
require('karma-jasmine-html-reporter'), |
|
||||
require('karma-coverage-istanbul-reporter'), |
|
||||
require('@angular-devkit/build-angular/plugins/karma') |
|
||||
], |
|
||||
client: { |
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
||||
}, |
|
||||
coverageIstanbulReporter: { |
|
||||
dir: require('path').join(__dirname, '../../coverage/setting-management-config'), |
|
||||
reports: ['html', 'lcovonly', 'text-summary'], |
|
||||
fixWebpackSourcePaths: true |
|
||||
}, |
|
||||
reporters: ['progress', 'kjhtml'], |
|
||||
port: 9876, |
|
||||
colors: true, |
|
||||
logLevel: config.LOG_INFO, |
|
||||
autoWatch: true, |
|
||||
browsers: ['Chrome'], |
|
||||
singleRun: false, |
|
||||
restartOnFileChange: true |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,21 +0,0 @@ |
|||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||
|
|
||||
import 'zone.js/dist/zone'; |
|
||||
import 'zone.js/dist/zone-testing'; |
|
||||
import { getTestBed } from '@angular/core/testing'; |
|
||||
import { |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting |
|
||||
} from '@angular/platform-browser-dynamic/testing'; |
|
||||
|
|
||||
declare const require: any; |
|
||||
|
|
||||
// First, initialize the Angular testing environment.
|
|
||||
getTestBed().initTestEnvironment( |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting() |
|
||||
); |
|
||||
// Then we find all the tests.
|
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
|
||||
// And load the modules.
|
|
||||
context.keys().map(context); |
|
||||
@ -1,32 +0,0 @@ |
|||||
// Karma configuration file, see link for more information
|
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||
|
|
||||
module.exports = function (config) { |
|
||||
config.set({ |
|
||||
basePath: '', |
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
||||
plugins: [ |
|
||||
require('karma-jasmine'), |
|
||||
require('karma-chrome-launcher'), |
|
||||
require('karma-jasmine-html-reporter'), |
|
||||
require('karma-coverage-istanbul-reporter'), |
|
||||
require('@angular-devkit/build-angular/plugins/karma') |
|
||||
], |
|
||||
client: { |
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
||||
}, |
|
||||
coverageIstanbulReporter: { |
|
||||
dir: require('path').join(__dirname, '../../coverage/setting-management'), |
|
||||
reports: ['html', 'lcovonly', 'text-summary'], |
|
||||
fixWebpackSourcePaths: true |
|
||||
}, |
|
||||
reporters: ['progress', 'kjhtml'], |
|
||||
port: 9876, |
|
||||
colors: true, |
|
||||
logLevel: config.LOG_INFO, |
|
||||
autoWatch: true, |
|
||||
browsers: ['Chrome'], |
|
||||
singleRun: false, |
|
||||
restartOnFileChange: true |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,21 +0,0 @@ |
|||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||
|
|
||||
import 'zone.js/dist/zone'; |
|
||||
import 'zone.js/dist/zone-testing'; |
|
||||
import { getTestBed } from '@angular/core/testing'; |
|
||||
import { |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting |
|
||||
} from '@angular/platform-browser-dynamic/testing'; |
|
||||
|
|
||||
declare const require: any; |
|
||||
|
|
||||
// First, initialize the Angular testing environment.
|
|
||||
getTestBed().initTestEnvironment( |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting() |
|
||||
); |
|
||||
// Then we find all the tests.
|
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
|
||||
// And load the modules.
|
|
||||
context.keys().map(context); |
|
||||
@ -1,32 +0,0 @@ |
|||||
// Karma configuration file, see link for more information
|
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||
|
|
||||
module.exports = function (config) { |
|
||||
config.set({ |
|
||||
basePath: '', |
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
||||
plugins: [ |
|
||||
require('karma-jasmine'), |
|
||||
require('karma-chrome-launcher'), |
|
||||
require('karma-jasmine-html-reporter'), |
|
||||
require('karma-coverage-istanbul-reporter'), |
|
||||
require('@angular-devkit/build-angular/plugins/karma') |
|
||||
], |
|
||||
client: { |
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
||||
}, |
|
||||
coverageIstanbulReporter: { |
|
||||
dir: require('path').join(__dirname, '../../coverage/tenant-management-config'), |
|
||||
reports: ['html', 'lcovonly', 'text-summary'], |
|
||||
fixWebpackSourcePaths: true |
|
||||
}, |
|
||||
reporters: ['progress', 'kjhtml'], |
|
||||
port: 9876, |
|
||||
colors: true, |
|
||||
logLevel: config.LOG_INFO, |
|
||||
autoWatch: true, |
|
||||
browsers: ['Chrome'], |
|
||||
singleRun: false, |
|
||||
restartOnFileChange: true |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,21 +0,0 @@ |
|||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||
|
|
||||
import 'zone.js/dist/zone'; |
|
||||
import 'zone.js/dist/zone-testing'; |
|
||||
import { getTestBed } from '@angular/core/testing'; |
|
||||
import { |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting |
|
||||
} from '@angular/platform-browser-dynamic/testing'; |
|
||||
|
|
||||
declare const require: any; |
|
||||
|
|
||||
// First, initialize the Angular testing environment.
|
|
||||
getTestBed().initTestEnvironment( |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting() |
|
||||
); |
|
||||
// Then we find all the tests.
|
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
|
||||
// And load the modules.
|
|
||||
context.keys().map(context); |
|
||||
@ -1,32 +0,0 @@ |
|||||
// Karma configuration file, see link for more information
|
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||
|
|
||||
module.exports = function (config) { |
|
||||
config.set({ |
|
||||
basePath: '', |
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
||||
plugins: [ |
|
||||
require('karma-jasmine'), |
|
||||
require('karma-chrome-launcher'), |
|
||||
require('karma-jasmine-html-reporter'), |
|
||||
require('karma-coverage-istanbul-reporter'), |
|
||||
require('@angular-devkit/build-angular/plugins/karma') |
|
||||
], |
|
||||
client: { |
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
||||
}, |
|
||||
coverageIstanbulReporter: { |
|
||||
dir: require('path').join(__dirname, '../../coverage/tenant-management'), |
|
||||
reports: ['html', 'lcovonly', 'text-summary'], |
|
||||
fixWebpackSourcePaths: true |
|
||||
}, |
|
||||
reporters: ['progress', 'kjhtml'], |
|
||||
port: 9876, |
|
||||
colors: true, |
|
||||
logLevel: config.LOG_INFO, |
|
||||
autoWatch: true, |
|
||||
browsers: ['Chrome'], |
|
||||
singleRun: false, |
|
||||
restartOnFileChange: true |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,21 +0,0 @@ |
|||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||
|
|
||||
import 'zone.js/dist/zone'; |
|
||||
import 'zone.js/dist/zone-testing'; |
|
||||
import { getTestBed } from '@angular/core/testing'; |
|
||||
import { |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting |
|
||||
} from '@angular/platform-browser-dynamic/testing'; |
|
||||
|
|
||||
declare const require: any; |
|
||||
|
|
||||
// First, initialize the Angular testing environment.
|
|
||||
getTestBed().initTestEnvironment( |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting() |
|
||||
); |
|
||||
// Then we find all the tests.
|
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
|
||||
// And load the modules.
|
|
||||
context.keys().map(context); |
|
||||
@ -1,32 +0,0 @@ |
|||||
// Karma configuration file, see link for more information
|
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||
|
|
||||
module.exports = function (config) { |
|
||||
config.set({ |
|
||||
basePath: '', |
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
||||
plugins: [ |
|
||||
require('karma-jasmine'), |
|
||||
require('karma-chrome-launcher'), |
|
||||
require('karma-jasmine-html-reporter'), |
|
||||
require('karma-coverage-istanbul-reporter'), |
|
||||
require('@angular-devkit/build-angular/plugins/karma') |
|
||||
], |
|
||||
client: { |
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
||||
}, |
|
||||
coverageIstanbulReporter: { |
|
||||
dir: require('path').join(__dirname, '../../coverage/theme-basic'), |
|
||||
reports: ['html', 'lcovonly'], |
|
||||
fixWebpackSourcePaths: true |
|
||||
}, |
|
||||
reporters: ['progress', 'kjhtml'], |
|
||||
port: 9876, |
|
||||
colors: true, |
|
||||
logLevel: config.LOG_INFO, |
|
||||
autoWatch: true, |
|
||||
browsers: ['Chrome'], |
|
||||
singleRun: false, |
|
||||
restartOnFileChange: true |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,21 +0,0 @@ |
|||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||
|
|
||||
import 'zone.js/dist/zone'; |
|
||||
import 'zone.js/dist/zone-testing'; |
|
||||
import { getTestBed } from '@angular/core/testing'; |
|
||||
import { |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting |
|
||||
} from '@angular/platform-browser-dynamic/testing'; |
|
||||
|
|
||||
declare const require: any; |
|
||||
|
|
||||
// First, initialize the Angular testing environment.
|
|
||||
getTestBed().initTestEnvironment( |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting() |
|
||||
); |
|
||||
// Then we find all the tests.
|
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
|
||||
// And load the modules.
|
|
||||
context.keys().map(context); |
|
||||
@ -0,0 +1,10 @@ |
|||||
|
const { pathsToModuleNameMapper } = require('ts-jest/utils'); |
||||
|
const { compilerOptions } = require('./tsconfig.spec'); |
||||
|
const jestConfig = require('../../jest.config'); |
||||
|
|
||||
|
module.exports = { |
||||
|
...jestConfig, |
||||
|
name: 'theme-shared', |
||||
|
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths /*, { prefix: '<rootDir>/' } */), |
||||
|
'ts-jest': { allowSyntheticDefaultImports: true }, |
||||
|
}; |
||||
@ -1,32 +0,0 @@ |
|||||
// Karma configuration file, see link for more information
|
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||
|
|
||||
module.exports = function(config) { |
|
||||
config.set({ |
|
||||
basePath: '', |
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|
||||
plugins: [ |
|
||||
require('karma-jasmine'), |
|
||||
require('karma-chrome-launcher'), |
|
||||
require('karma-jasmine-html-reporter'), |
|
||||
require('karma-coverage-istanbul-reporter'), |
|
||||
require('@angular-devkit/build-angular/plugins/karma'), |
|
||||
], |
|
||||
client: { |
|
||||
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
|
||||
}, |
|
||||
coverageIstanbulReporter: { |
|
||||
dir: require('path').join(__dirname, '../../coverage/theme-shared'), |
|
||||
reports: ['html', 'lcovonly'], |
|
||||
fixWebpackSourcePaths: true, |
|
||||
}, |
|
||||
reporters: ['progress', 'kjhtml'], |
|
||||
port: 9876, |
|
||||
colors: true, |
|
||||
logLevel: config.LOG_INFO, |
|
||||
autoWatch: true, |
|
||||
browsers: ['Chrome'], |
|
||||
singleRun: false, |
|
||||
restartOnFileChange: true, |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,21 +0,0 @@ |
|||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||
|
|
||||
import 'zone.js/dist/zone'; |
|
||||
import 'zone.js/dist/zone-testing'; |
|
||||
import { getTestBed } from '@angular/core/testing'; |
|
||||
import { |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting |
|
||||
} from '@angular/platform-browser-dynamic/testing'; |
|
||||
|
|
||||
declare const require: any; |
|
||||
|
|
||||
// First, initialize the Angular testing environment.
|
|
||||
getTestBed().initTestEnvironment( |
|
||||
BrowserDynamicTestingModule, |
|
||||
platformBrowserDynamicTesting() |
|
||||
); |
|
||||
// Then we find all the tests.
|
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
|
||||
// And load the modules.
|
|
||||
context.keys().map(context); |
|
||||
@ -1,17 +1,14 @@ |
|||||
{ |
{ |
||||
"extends": "../../tsconfig.json", |
"extends": "../../tsconfig.json", |
||||
"compilerOptions": { |
"compilerOptions": { |
||||
"outDir": "../../out-tsc/spec", |
"emitDecoratorMetadata": true, |
||||
"types": [ |
"esModuleInterop": true, |
||||
"jasmine", |
"outDir": "../../dist/out-tsc", |
||||
"node" |
"module": "commonjs", |
||||
] |
"types": ["jest", "node"], |
||||
|
"paths": { |
||||
|
"@abp/ng.theme-shared/*": ["packages/theme-shared/src/lib/*"] |
||||
|
} |
||||
}, |
}, |
||||
"files": [ |
"include": ["**/*.spec.ts", "**/*.d.ts"] |
||||
"src/test.ts" |
|
||||
], |
|
||||
"include": [ |
|
||||
"**/*.spec.ts", |
|
||||
"**/*.d.ts" |
|
||||
] |
|
||||
} |
} |
||||
|
|||||
@ -0,0 +1 @@ |
|||||
|
import 'jest-preset-angular'; |
||||
Loading…
Reference in new issue