Skip to content

Commit d46cf71

Browse files
committed
Reorganize scripts
1 parent 6d4b748 commit d46cf71

12 files changed

+38
-203
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/mod.ts renamed to mod.ts

File renamed without changes.

package-lock.json

Lines changed: 0 additions & 165 deletions
This file was deleted.

src/symbol.ts renamed to symbol.ts

File renamed without changes.

src/Observable.test.ts renamed to tests/Observable.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import { Observable } from "./Observable.ts";
2-
import {
3-
assertEquals,
4-
assert
5-
} from "https://deno.land/std/testing/asserts.ts";
6-
import { isSubscription } from "./utils.ts";
1+
import { assertEquals, assert } from "https://deno.land/std/testing/asserts.ts";
2+
import { Observable } from "../Observable.ts";
3+
import { isSubscription } from "../utils.ts";
74

85
function expectFullObserver(val: any) {
96
assertEquals(typeof val, "object");

src/Subscription.test.ts renamed to tests/Subscription.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010
Subscription,
1111
SubscriptionLike,
1212
normalizeCleanUp
13-
} from "./Subscription.ts";
14-
import { assertIsCleanUp } from "./utils.ts";
13+
} from "../Subscription.ts";
14+
import { assertIsCleanUp } from "../utils.ts";
1515

1616
Deno.test(`
1717
Subscription:

src/SubscriptionObserver.test.ts renamed to tests/SubscriptionObserver.test.ts

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import {
2-
assertEquals
3-
} from "https://deno.land/std/testing/asserts.ts";
4-
import { SubscriptionObserver } from "./SubscriptionObserver.ts";
5-
import { Subscription } from "./Subscription.ts";
1+
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
2+
import { SubscriptionObserver } from "../SubscriptionObserver.ts";
3+
import { Subscription } from "../Subscription.ts";
64

75
Deno.test({
86
name: `
@@ -52,19 +50,23 @@ it should ignore error messages after unsubscription
5250
let times = 0;
5351
let errorCalled = false;
5452
const subscription = new Subscription({
55-
next() { times += 1; },
56-
error() { errorCalled = true; }
57-
})
58-
const subscriptionObserver = new SubscriptionObserver<void>(subscription)
53+
next() {
54+
times += 1;
55+
},
56+
error() {
57+
errorCalled = true;
58+
},
59+
});
60+
const subscriptionObserver = new SubscriptionObserver<void>(subscription);
5961

6062
subscriptionObserver.next();
6163
subscriptionObserver.next();
6264
subscription.unsubscribe();
6365
subscriptionObserver.next();
6466
subscriptionObserver.error(undefined);
6567

66-
assertEquals(times, 2)
67-
assertEquals(errorCalled, false)
68+
assertEquals(times, 2);
69+
assertEquals(errorCalled, false);
6870
});
6971

7072
Deno.test(`
@@ -74,9 +76,13 @@ SubscriptionObserver: it should ignore complete messages after unsubscription
7476
let completeCalled = false;
7577

7678
const subscription = new Subscription({
77-
next() { times += 1; },
78-
complete() { completeCalled = true; }
79-
})
79+
next() {
80+
times += 1;
81+
},
82+
complete() {
83+
completeCalled = true;
84+
},
85+
});
8086

8187
const subscriptionObserver = new SubscriptionObserver<void>(subscription);
8288

@@ -86,41 +92,40 @@ SubscriptionObserver: it should ignore complete messages after unsubscription
8692
subscriptionObserver.next();
8793
subscriptionObserver.complete();
8894

89-
assertEquals(times, 2)
90-
assertEquals(completeCalled, false)
95+
assertEquals(times, 2);
96+
assertEquals(completeCalled, false);
9197
});
9298

9399
Deno.test(`
94100
SubscriptionObserver:
95101
it should not be closed when other subscriber with same observer instance completes
96102
`, () => {
97103
const observer = {
98-
next() { /*noop*/ }
99-
}
100-
const sub1 = new SubscriptionObserver(new Subscription(observer))
101-
const sub2 = new SubscriptionObserver(new Subscription(observer))
102-
104+
next() {/*noop*/},
105+
};
106+
const sub1 = new SubscriptionObserver(new Subscription(observer));
107+
const sub2 = new SubscriptionObserver(new Subscription(observer));
103108

104109
sub2.complete();
105110

106-
assertEquals(sub1.closed, false)
107-
assertEquals(sub2.closed, true)
111+
assertEquals(sub1.closed, false);
112+
assertEquals(sub2.closed, true);
108113
});
109114

110115
Deno.test(`
111116
SubscriptionOnserver:
112117
it should call complete observer without any arguments
113118
`, () => {
114-
let argument: any[] = []
119+
let argument: any[] = [];
115120

116121
const observer = {
117122
complete: (...args: any[]) => {
118123
argument = args;
119-
}
124+
},
120125
};
121126

122127
const sub1 = new SubscriptionObserver(new Subscription(observer));
123128
sub1.complete();
124129

125-
assertEquals(argument.length, 0)
130+
assertEquals(argument.length, 0);
126131
});

src/symbol.test.ts renamed to tests/symbol.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import {
2-
assert
3-
} from "https://deno.land/std/testing/asserts.ts";
1+
import { assert } from "https://deno.land/std/testing/asserts.ts";
42

5-
import "./symbol.ts";
3+
import "../symbol.ts";
64

75
Deno.test({
86
name: "Symbol.observable",

src/utils.ts renamed to utils.ts

File renamed without changes.

0 commit comments

Comments
 (0)