This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
globals: { | |
'ts-jest': { | |
tsConfig: './tsconfig.spec.json', | |
stringifyContentPathRegex: '\\.html$', | |
astTransformers: [ | |
require.resolve('jest-preset-angular/InlineHtmlStripStylesTransformer') | |
] | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ngxWallabyJest = require('ngx-wallaby-jest'); | |
module.exports = function(wallaby) { | |
return { | |
files: [ | |
'src/**/*.+(ts|html|json|snap|css|less|sass|scss|jpg|jpeg|gif|png|svg)', | |
'tsconfig.json', | |
'jest.config.js', | |
'tsconfig.spec.json', | |
'!src/**/*.spec.ts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SpectatorService, SpyObject, createService } from '@netbasal/spectator/jest'; | |
import { MatSnackBar } from '@angular/material/snack-bar'; | |
import { NotificationService } from './notification.service'; | |
describe('Service: NotificationService', () => { | |
let snackBar: SpyObject<MatSnackBar>; | |
let spectator: SpectatorService<NotificationService> = createService({ | |
service: NotificationService, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface AwesomeEntity { | |
id: number; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SpectatorService, SpyObject, createService } from '@netbasal/spectator/jest'; | |
import { of } from 'rxjs'; | |
import { AwesomeEntityStore } from './entity.store'; | |
import { EntityDataService } from './entity-data.service'; | |
import { EntityService } from './entity.service'; | |
describe('Service: EntityService', () => { | |
let dataService: SpyObject<EntityDataService>; | |
let store: SpyObject<AwesomeEntityStore>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Spectator, SpyObject, createTestComponentFactory } from '@netbasal/spectator/jest'; | |
import { of } from 'rxjs'; | |
import { StatefulComponent } from './stateful.component'; | |
import { AwesomeEntitiesQuery } from './+state'; | |
describe('Component: StatefulComponent', () => { | |
let query: SpyObject<AwesomeEntitiesQuery>; | |
let spectator: Spectator<StatefulComponent>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { MatSnackBar } from '@angular/material/snack-bar'; | |
@Injectable({ providedIn: 'root' }) | |
export class NotificationService { | |
constructor(private _snackBar: MatSnackBar) {} | |
notify(message: string, duration = 7000): void { | |
this._snackBar.open(message, 'CLOSE', { duration }); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SpectatorService, SpyObject, createService } from '@netbasal/spectator/jest'; | |
import { MatSnackBar } from '@angular/material/snack-bar'; | |
import { NotificationService } from './notification.service'; | |
describe('Service: NotificationService', () => { | |
let snackBar: SpyObject<MatSnackBar>; | |
let spectator: SpectatorService<NotificationService> = createService({ | |
service: NotificationService, |
OlderNewer