Skip to content

Commit

Permalink
some typescript adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Mar 11, 2020
1 parent c9d8898 commit 760ddbe
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
6 changes: 6 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
TODO: add qunit-dom.js to build system

TODO: add ember-test-helpers addon-test-helpers types to tsconfig



Adapter and Serializer in new ember + documentation expressions
only Serializer EmbeddedRecordsMixin solution is needed

Expand Down
7 changes: 7 additions & 0 deletions ember-app-boilerplate/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from '../config/environment';

declare global {
interface Window {
runningTests: any;
Ember: any;
}
}

export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Expand Down
22 changes: 22 additions & 0 deletions ember-app-boilerplate/tests/test-helper.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
declare module "ember-test-helpers" {
interface Element {
querySelector: (selectorText: string) => Element;
value: any;
textContent: any;
type: any;
required: any;
getAttribute: any;
autofocus: any;
previousElementSibling: any;
nextElementSibling: any;
placeholder: any;
[propName: string]: any;
}

interface TestContext {
[propName: string]: any;
element: Element;
}
}

declare global {
interface EventTarget {
parentElement: Element
}
}

import 'qunit-dom';
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-qunit';
import Application from '../src/main';
Expand Down
11 changes: 10 additions & 1 deletion ember-app-boilerplate/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"target": "es2017",
"typeRoots" : ["./node_modules/@types"],
"allowJs": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand All @@ -27,9 +28,16 @@
"{{applicationName}}/config/*": [
"config/*"
],
"{{applicationName}}/*": [
"{{applicationName}}/src/*": [
"src/*"
],
"{{applicationName}}/memserver/*": [
"memserver/*"
],
"{{applicationName}}/documentation/*": [
"documentation/*"
],
"@glimmer": ["node_modules/@glimmer/component/dist/types/src/*"],
"*": [
"types/*"
]
Expand All @@ -38,6 +46,7 @@
"include": [
"src/**/*",
"tests/**/*",
"documentation/**/*",
"types/**/*"
],
"exclude": [
Expand Down

0 comments on commit 760ddbe

Please sign in to comment.