Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(angular-material): relocated tests #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions packages/angular-material/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
var options = {
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
Expand All @@ -25,14 +25,13 @@ module.exports = function (config) {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
//dir: require('path').join(__dirname, '../../coverage/angular-material'),
subdir: '.',
reporters: [
{ type: 'lcov' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml', 'dots'],
reporters: ['progress', 'kjhtml', 'dots', 'coverage'],

browsers: [ config.singleRun ? 'ChromeHeadlessNoSandbox' : 'Chrome' ],
customLaunchers: {
Expand All @@ -51,5 +50,6 @@ module.exports = function (config) {
webpackServer: {
noInfo: true,
},
});
};
config.set(options);
};
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import {
getJsonFormsService,
} from '@jsonforms/angular-test';
import { ControlElement, JsonSchema, Actions } from '@jsonforms/core';
import { AutocompleteControlRenderer } from '../src';
import { AutocompleteControlRenderer } from './autocomplete.renderer';
import { JsonFormsAngularService } from '@jsonforms/angular';
import { ErrorObject } from 'ajv';
import { FlexLayoutModule } from '@angular/flex-layout';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
booleanInputEventTest,
ErrorTestExpectation,
} from '@jsonforms/angular-test';
import { BooleanControlRenderer, booleanControlTester } from '../src';
import { BooleanControlRenderer, booleanControlTester } from './boolean.renderer';
import { FlexLayoutModule } from '@angular/flex-layout';
import { JsonFormsAngularService } from '@jsonforms/angular';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ import {
setupMockStore,
} from '@jsonforms/angular-test';
import { Actions, ControlElement, JsonSchema } from '@jsonforms/core';
import { DateControlRenderer, DateControlRendererTester } from '../src';
import { DateControlRenderer, DateControlRendererTester } from './date.renderer';
import { FlexLayoutModule } from '@angular/flex-layout';
import { JsonFormsAngularService } from '@jsonforms/angular';
import { createTesterContext } from './util';
import { createTesterContext } from '../../test/util';

const data = { foo: '2018-01-01' };
const schema: JsonSchema = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
prepareComponent,
} from '@jsonforms/angular-test';
import { Actions, ControlElement, JsonFormsCore } from '@jsonforms/core';
import { NumberControlRenderer, NumberControlRendererTester } from '../src';
import { NumberControlRenderer, NumberControlRendererTester } from './number.renderer';

describe('Material number field tester', () => {
const uischema = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
rangeErrorTest,
rangeInputEventTest,
} from '@jsonforms/angular-test';
import { RangeControlRenderer, RangeControlRendererTester } from '../src';
import { RangeControlRenderer, RangeControlRendererTester } from './range.renderer';
import { FlexLayoutModule } from '@angular/flex-layout';
import { JsonFormsAngularService } from '@jsonforms/angular';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
textInputEventTest,
textTypeTest,
} from '@jsonforms/angular-test';
import { TextControlRenderer, TextControlRendererTester } from '../src';
import { TextControlRenderer, TextControlRendererTester } from './text.renderer';
import { FlexLayoutModule } from '@angular/flex-layout';
import { JsonFormsAngularService } from '@jsonforms/angular';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
textErrorTest,
textInputEventTest,
} from '@jsonforms/angular-test';
import { TextAreaRenderer, TextAreaRendererTester } from '../src';
import { TextAreaRenderer, TextAreaRendererTester } from './textarea.renderer';
import { ControlElement, JsonSchema } from '@jsonforms/core';
import { FlexLayoutModule } from '@angular/flex-layout';
import { JsonFormsAngularService } from '@jsonforms/angular';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
booleanInputEventTest,
ErrorTestExpectation,
} from '@jsonforms/angular-test';
import { ToggleControlRenderer, ToggleControlRendererTester } from '../src';
import { ToggleControlRenderer, ToggleControlRendererTester } from './toggle.renderer';
import { FlexLayoutModule } from '@angular/flex-layout';
import { JsonFormsAngularService } from '@jsonforms/angular';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ import {
} from '@jsonforms/angular';
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
import {
CategorizationTabLayoutRenderer,
CategorizationTabLayoutRenderer
} from './categorization-layout.renderer';
import {
TextControlRenderer,
TextControlRendererTester,
} from '../src';
} from '../controls/text.renderer';
import { FlexLayoutModule } from '@angular/flex-layout';
import { setupMockStore, getJsonFormsService } from '@jsonforms/angular-test';
import { MatFormFieldModule } from '@angular/material/form-field';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { beforeEachLayoutTest, setupMockStore } from '@jsonforms/angular-test';
import { FlexLayoutModule } from '@angular/flex-layout';
import { LayoutChildrenRenderPropsPipe } from '../src/layouts/layout.renderer';
import { LayoutChildrenRenderPropsPipe } from './layout.renderer';
import {
GroupLayoutRenderer,
groupLayoutTester,
} from '../src/layouts/group-layout.renderer';
} from './group-layout.renderer';

describe('Group layout tester', () => {
it('should succeed', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import { FlexLayoutModule } from '@angular/flex-layout';
import {
HorizontalLayoutRenderer,
horizontalLayoutTester,
} from '../src/layouts/horizontal-layout.renderer';
import { LayoutChildrenRenderPropsPipe } from '../src/layouts/layout.renderer';
} from './horizontal-layout.renderer';
import { LayoutChildrenRenderPropsPipe } from './layout.renderer';

describe('Horizontal layout tester', () => {
it('should succeed', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import { FlexLayoutModule } from '@angular/flex-layout';
import {
VerticalLayoutRenderer,
verticalLayoutTester,
} from '../src/layouts/vertical-layout.renderer';
import { LayoutChildrenRenderPropsPipe } from '../src/layouts/layout.renderer';
} from './vertical-layout.renderer';
import { LayoutChildrenRenderPropsPipe } from './layout.renderer';

describe('Vertical layout tester', () => {
it('should succeed', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { JsonSchema, LabelElement } from '@jsonforms/core';

import { LabelRenderer, LabelRendererTester } from '../src/other';
import { LabelRenderer, LabelRendererTester } from './label.renderer';
import { setupMockStore } from '@jsonforms/angular-test';
import { JsonFormsAngularService } from '@jsonforms/angular';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import {
} from '@jsonforms/angular';
import { FlexLayoutModule } from '@angular/flex-layout';
import { DebugElement } from '@angular/core';
import { MasterListComponent } from '../src/other/master-detail/master';
import { JsonFormsDetailComponent } from '../src/other/master-detail/detail';
import { MasterListComponent } from './master';
import { JsonFormsDetailComponent } from './detail';
import { getJsonFormsService, setupMockStore } from '@jsonforms/angular-test';
import { Actions } from '@jsonforms/core';
import { MatTooltipModule } from '@angular/material/tooltip';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,19 @@ import { ControlElement } from '@jsonforms/core';
import {
GroupLayoutRenderer,
groupLayoutTester,
TextControlRenderer,
TextControlRendererTester,
VerticalLayoutRenderer,
verticalLayoutTester,
} from '../src';
LayoutChildrenRenderPropsPipe
} from '../layouts';
import {
TextControlRenderer,
TextControlRendererTester,
} from '../controls';
import {
ObjectControlRenderer,
ObjectControlRendererTester,
} from '../src/other/object.renderer';
} from './object.renderer';
import { getJsonFormsService } from '@jsonforms/angular-test';
import { LayoutChildrenRenderPropsPipe } from '../src/layouts/layout.renderer';

const uischema1: ControlElement = { type: 'Control', scope: '#' };
const uischema2: ControlElement = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/t
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { JsonFormsAngularService, JsonFormsModule } from '@jsonforms/angular';
import { ControlElement } from '@jsonforms/core';
import { TextControlRenderer, TextControlRendererTester } from '../src';
import { TextControlRenderer, TextControlRendererTester } from '../controls';
import {
TableRenderer,
TableRendererTester,
} from '../src/other/table.renderer';
} from './table.renderer';
import { FlexLayoutModule } from '@angular/flex-layout';
import { setupMockStore } from '@jsonforms/angular-test';
import { createTesterContext } from './util';
import { createTesterContext } from '../../test/util';
import { MatTooltipModule } from '@angular/material/tooltip';

const uischema1: ControlElement = { type: 'Control', scope: '#' };
Expand Down
3 changes: 2 additions & 1 deletion packages/angular-material/test-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const defaultWebpackOptions = {

const normalizeOptions = (options, context) => {
return {
progress: true,
...defaultWebpackOptions,
...options
}
Expand Down Expand Up @@ -71,7 +72,7 @@ const karmaConfigOptionsTransform = (options, context, karmaConfigOptions) => {
karmaConfig: 'packages/angular-material/karma.conf.js'
}
const root = `packages/${project}`;
const sourceRoot = root + '/test';
const sourceRoot = root + '/src';
const teardownLogics = [];
const context = {
workspaceRoot,
Expand Down
11 changes: 0 additions & 11 deletions packages/angular-material/test/tsconfig.test.json

This file was deleted.

5 changes: 4 additions & 1 deletion packages/angular-material/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"sourceMap": true,
"target": "es5"
},
"exclude": ["node_modules"],
"exclude": [
"node_modules",
"**/*.spec.ts",
],
"files": ["./src/index.ts"],
"angularCompilerOptions": {
"compilationMode": "partial",
Expand Down
4 changes: 4 additions & 0 deletions packages/angular-material/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
"jasmine"
]
},
"exclude": [
"node_modules"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
],
"files": ["./src/index.ts"],
"angularCompilerOptions": {
"compilationMode": "partial",
"strictMetadataEmit": true,
Expand Down