Skip to content

Commit

Permalink
Making sure all test-based code is inside an explicitly-named test mo…
Browse files Browse the repository at this point in the history
…dule, to prevent using test code in definition files.
  • Loading branch information
fredgalvao authored and AGBrown committed Sep 28, 2015
1 parent 2512453 commit 6839600
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions pouchdb-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,34 @@
/// <reference path="pouchdb-loose.d.ts" />
/// <reference path="pouchdb-plugins.d.ts" />

module promise {
class Foo {
foo: string;
}
module PouchDBTest {
module promise {
class Foo {
foo: string;
}

class fakePromise<T> implements Promise<T> {
new() { }
class fakePromise<T> implements Promise<T> {
new() { }

then<R>(onFulfilled?: (value: T) => Promise<R> | R, onRejected?: (error: any) => Promise<R> | R) {
return new fakePromise<R>();
}
then<R>(onFulfilled?: (value: T) => Promise<R> | R, onRejected?: (error: any) => Promise<R> | R) {
return new fakePromise<R>();
}

catch<R>(onRejected: (error: any) => Promise<R> | R) {
return undefined;
}
catch<R>(onRejected: (error: any) => Promise<R> | R) {
return undefined;
}

[Symbol.toStringTag]: string;
}
[Symbol.toStringTag]: string;
}

function chainedThen() {
var fooOut: string;
new PouchDB("dbname")
.then((db) => new fakePromise<Foo>())
.then((value: Foo) => { fooOut = value.foo; });
function chainedThen() {
var fooOut: string;
new PouchDB("dbname")
.then((db) => new fakePromise<Foo>())
.then((value: Foo) => { fooOut = value.foo; });
}
}
}

module PouchDBTest {
module localDb {
// common variables
var dbt: pouchdb.thenable.PouchDB;
Expand Down

0 comments on commit 6839600

Please sign in to comment.