Skip to content

Commit

Permalink
chore(all): prepare release 1.0.0-beta.3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Mar 25, 2017
1 parent 1ecfbfe commit b04ac87
Show file tree
Hide file tree
Showing 12 changed files with 183 additions and 166 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-testing",
"version": "1.0.0-beta.3.0.0",
"version": "1.0.0-beta.3.0.1",
"description": "A collection of helpers for testing Aurelia apps and components.",
"keywords": [
"aurelia",
Expand Down
6 changes: 3 additions & 3 deletions dist/amd/component-tester.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['exports', 'aurelia-templating', 'aurelia-framework'], function (exports, _aureliaTemplating, _aureliaFramework) {
define(['exports', 'aurelia-templating', 'aurelia-framework', './wait'], function (exports, _aureliaTemplating, _aureliaFramework, _wait) {
'use strict';

Object.defineProperty(exports, "__esModule", {
Expand Down Expand Up @@ -152,15 +152,15 @@ define(['exports', 'aurelia-templating', 'aurelia-framework'], function (exports
ComponentTester.prototype.waitForElement = function waitForElement(selector, options) {
var _this3 = this;

return waitFor(function () {
return (0, _wait.waitFor)(function () {
return _this3.element.querySelector(selector);
}, options);
};

ComponentTester.prototype.waitForElements = function waitForElements(selector, options) {
var _this4 = this;

return waitFor(function () {
return (0, _wait.waitFor)(function () {
return _this4.element.querySelectorAll(selector);
}, options);
};
Expand Down
50 changes: 25 additions & 25 deletions dist/aurelia-testing.d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import * as LogManager from 'aurelia-logging';
import {
View,
customAttribute,
TargetInstruction
TargetInstruction,
View
} from 'aurelia-templating';
import {
Aurelia
} from 'aurelia-framework';
import {
inject
} from 'aurelia-dependency-injection';
import {
DOM
} from 'aurelia-pal';
import {
Aurelia
} from 'aurelia-framework';

/**
* Generic function to wait for something to happen. Uses polling
Expand All @@ -25,26 +25,6 @@ import {
export declare function waitFor(getter: (() => any), options: any): Promise<any>;
export declare function waitForDocumentElement(selector: string, options: any): Promise<Element>;
export declare function waitForDocumentElements(selector: string, options: any): Promise<Element>;
export declare class StageComponent {
static withResources(resources: string | string[]): ComponentTester;
}
export declare class ComponentTester {
bind: ((bindingContext: any) => void);
attached: (() => void);
unbind: (() => void);
element: Element;
viewModel: any;
configure: any;
bootstrap(configure: ((aurelia: Aurelia) => void)): any;
withResources(resources: string | string[]): ComponentTester;
inView(html: string): ComponentTester;
boundTo(bindingContext: any): ComponentTester;
manuallyHandleLifecycle(): ComponentTester;
create(bootstrap: ((configure: ((aurelia: Aurelia) => Promise<void>)) => Promise<void>)): Promise<void>;
dispose(): any;
waitForElement(selector: string, options: any): Promise<Element>;
waitForElements(selector: string, options: any): Promise<Element>;
}

/**
* Attribute to be placed on any HTML element in a view to emit the View instance
Expand Down Expand Up @@ -99,4 +79,24 @@ export declare class CompileSpy {
* @param instruction instructions for how the target element should be enhanced.
*/
constructor(element?: any, instruction?: any);
}
export declare class StageComponent {
static withResources(resources?: string | string[]): ComponentTester;
}
export declare class ComponentTester {
bind: ((bindingContext: any) => void);
attached: (() => void);
unbind: (() => void);
element: Element;
viewModel: any;
configure: any;
bootstrap(configure: ((aurelia: Aurelia) => void)): any;
withResources(resources: string | string[]): ComponentTester;
inView(html: string): ComponentTester;
boundTo(bindingContext: any): ComponentTester;
manuallyHandleLifecycle(): ComponentTester;
create(bootstrap: ((configure: ((aurelia: Aurelia) => Promise<void>)) => Promise<void>)): Promise<void>;
dispose(): any;
waitForElement(selector: string, options: any): Promise<Element>;
waitForElements(selector: string, options: any): Promise<Element>;
}
164 changes: 82 additions & 82 deletions dist/aurelia-testing.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as LogManager from 'aurelia-logging';
import {View,customAttribute,TargetInstruction} from 'aurelia-templating';
import {Aurelia} from 'aurelia-framework';
import {customAttribute,TargetInstruction,View} from 'aurelia-templating';
import {inject} from 'aurelia-dependency-injection';
import {DOM} from 'aurelia-pal';
import {Aurelia} from 'aurelia-framework';

/**
* Generic function to wait for something to happen. Uses polling
Expand Down Expand Up @@ -55,8 +55,87 @@ export function waitForDocumentElements(selector: string, options: any): Promise
return waitFor(() => document.querySelectorAll(selector), options);
}

/**
* Attribute to be placed on any HTML element in a view to emit the View instance
* to the debug console, giving you insight into the live View instance, including
* all child views, live bindings, behaviors and more.
*/
@customAttribute('view-spy')
export class ViewSpy {
/**
* Creates a new instance of ViewSpy.
*/
constructor() {
this.logger = LogManager.getLogger('view-spy');
}

_log(lifecycleName, context) {
if (!this.value && lifecycleName === 'created' ) {
this.logger.info(lifecycleName, this.view);
} else if (this.value && this.value.indexOf(lifecycleName) !== -1) {
this.logger.info(lifecycleName, this.view, context);
}
}

/**
* Invoked when the target view is created.
* @param view The target view.
*/
created(view) {
this.view = view;
this._log('created');
}

/**
* Invoked when the target view is bound.
* @param bindingContext The target view's binding context.
*/
bind(bindingContext) {
this._log('bind', bindingContext);
}

/**
* Invoked when the target element is attached to the DOM.
*/
attached() {
this._log('attached');
}

/**
* Invoked when the target element is detached from the DOM.
*/
detached() {
this._log('detached');
}

/**
* Invoked when the target element is unbound.
*/
unbind() {
this._log('unbind');
}
}

/**
* Attribute to be placed on any element to have it emit the View Compiler's
* TargetInstruction into the debug console, giving you insight into all the
* parsed bindings, behaviors and event handers for the targeted element.
*/
@customAttribute('compile-spy')
@inject(DOM.Element, TargetInstruction)
export class CompileSpy {
/**
* Creates and instanse of CompileSpy.
* @param element target element on where attribute is placed on.
* @param instruction instructions for how the target element should be enhanced.
*/
constructor(element, instruction) {
LogManager.getLogger('compile-spy').info(element, instruction);
}
}

export class StageComponent {
static withResources(resources: string | string[]): ComponentTester {
static withResources(resources?: string | string[]): ComponentTester {
return new ComponentTester().withResources(resources);
}
}
Expand Down Expand Up @@ -181,82 +260,3 @@ export class ComponentTester {
return waitFor(() => this.element.querySelectorAll(selector), options);
}
}

/**
* Attribute to be placed on any HTML element in a view to emit the View instance
* to the debug console, giving you insight into the live View instance, including
* all child views, live bindings, behaviors and more.
*/
@customAttribute('view-spy')
export class ViewSpy {
/**
* Creates a new instance of ViewSpy.
*/
constructor() {
this.logger = LogManager.getLogger('view-spy');
}

_log(lifecycleName, context) {
if (!this.value && lifecycleName === 'created' ) {
this.logger.info(lifecycleName, this.view);
} else if (this.value && this.value.indexOf(lifecycleName) !== -1) {
this.logger.info(lifecycleName, this.view, context);
}
}

/**
* Invoked when the target view is created.
* @param view The target view.
*/
created(view) {
this.view = view;
this._log('created');
}

/**
* Invoked when the target view is bound.
* @param bindingContext The target view's binding context.
*/
bind(bindingContext) {
this._log('bind', bindingContext);
}

/**
* Invoked when the target element is attached to the DOM.
*/
attached() {
this._log('attached');
}

/**
* Invoked when the target element is detached from the DOM.
*/
detached() {
this._log('detached');
}

/**
* Invoked when the target element is unbound.
*/
unbind() {
this._log('unbind');
}
}

/**
* Attribute to be placed on any element to have it emit the View Compiler's
* TargetInstruction into the debug console, giving you insight into all the
* parsed bindings, behaviors and event handers for the targeted element.
*/
@customAttribute('compile-spy')
@inject(DOM.Element, TargetInstruction)
export class CompileSpy {
/**
* Creates and instanse of CompileSpy.
* @param element target element on where attribute is placed on.
* @param instruction instructions for how the target element should be enhanced.
*/
constructor(element, instruction) {
LogManager.getLogger('compile-spy').info(element, instruction);
}
}
6 changes: 4 additions & 2 deletions dist/commonjs/component-tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ var _aureliaTemplating = require('aurelia-templating');

var _aureliaFramework = require('aurelia-framework');

var _wait = require('./wait');



var StageComponent = exports.StageComponent = function () {
Expand Down Expand Up @@ -155,15 +157,15 @@ var ComponentTester = exports.ComponentTester = function () {
ComponentTester.prototype.waitForElement = function waitForElement(selector, options) {
var _this3 = this;

return waitFor(function () {
return (0, _wait.waitFor)(function () {
return _this3.element.querySelector(selector);
}, options);
};

ComponentTester.prototype.waitForElements = function waitForElements(selector, options) {
var _this4 = this;

return waitFor(function () {
return (0, _wait.waitFor)(function () {
return _this4.element.querySelectorAll(selector);
}, options);
};
Expand Down
1 change: 1 addition & 0 deletions dist/es2015/component-tester.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { View } from 'aurelia-templating';
import { Aurelia } from 'aurelia-framework';
import { waitFor } from './wait';

export let StageComponent = class StageComponent {
static withResources(resources) {
Expand Down
1 change: 1 addition & 0 deletions dist/native-modules/component-tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { View } from 'aurelia-templating';
import { Aurelia } from 'aurelia-framework';
import { waitFor } from './wait';

export var StageComponent = function () {
function StageComponent() {
Expand Down
6 changes: 4 additions & 2 deletions dist/system/component-tester.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

System.register(['aurelia-templating', 'aurelia-framework'], function (_export, _context) {
System.register(['aurelia-templating', 'aurelia-framework', './wait'], function (_export, _context) {
"use strict";

var View, Aurelia, StageComponent, ComponentTester;
var View, Aurelia, waitFor, StageComponent, ComponentTester;



Expand All @@ -12,6 +12,8 @@ System.register(['aurelia-templating', 'aurelia-framework'], function (_export,
View = _aureliaTemplating.View;
}, function (_aureliaFramework) {
Aurelia = _aureliaFramework.Aurelia;
}, function (_wait) {
waitFor = _wait.waitFor;
}],
execute: function () {
_export('StageComponent', StageComponent = function () {
Expand Down
Loading

0 comments on commit b04ac87

Please sign in to comment.