Skip to content

Commit

Permalink
Revert "chore(tests): more debugging to figure out why tests stuck on…
Browse files Browse the repository at this point in the history
… CI"

This reverts commit 7dd0401.
  • Loading branch information
gadicc committed Feb 16, 2022
1 parent b328fb1 commit ba2ed67
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions src/other/quoteCombine.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,17 @@ describe("quoteCombine", () => {
afterEach(() => jest.useRealTimers());

it("works with a single result", (done) => {
console.log("works with a single result - START");
const devel = "quoteCombine-AAPL.json";
yf.quoteCombine("AAPL", undefined, { devel })
.then((result: any) => {
expect(result.symbol).toBe("AAPL");
console.log("works with a single result - DONE");
done();
})
.catch(done);
jest.runAllTimers();
});

it("works with two results", (done) => {
console.log("works with two results - START");
const opts = { devel: "quoteCombine-AAPL-TSLA.json" };
Promise.all([
yf.quoteCombine("AAPL", undefined, opts).then((result: any) => {
Expand All @@ -34,22 +31,17 @@ describe("quoteCombine", () => {
expect(result.symbol).toBe("TSLA");
}),
])
.then(() => {
console.log("works with two results - DONE");
done();
})
.then(() => done())
.catch(done);

jest.runAllTimers();
});

it("resolves undefined for single missing symbol", (done) => {
const devel = "quoteCombine-NONEXIST.json";
console.log("resolves undefined for single missing symbol - START");
yf.quoteCombine("NONEXIST", undefined, { devel })
.then((result: any) => {
expect(result).toBe(undefined);
console.log("resolves undefined for single missing symbol - DONE");
done();
})
.catch(done);
Expand All @@ -58,9 +50,6 @@ describe("quoteCombine", () => {

it("resolves undefined for missing symbols + resolves found", (done) => {
const opts = { devel: "quoteCombine-AAPL-NONEXIST.json" };
console.log(
"resolves undefined for missing symbols + resolves found - START"
);
Promise.all([
yf.quoteCombine("AAPL", undefined, opts).then((result: any) => {
expect(result.symbol).toBe("AAPL");
Expand All @@ -70,12 +59,7 @@ describe("quoteCombine", () => {
expect(result).toBe(undefined);
}),
])
.then(() => {
console.log(
"resolves undefined for missing symbols + resolves found - DONE"
);
done();
})
.then(() => done())
.catch(done);

jest.runAllTimers();
Expand All @@ -87,11 +71,8 @@ describe("quoteCombine", () => {

if (process.env.FETCH_DEVEL !== "nocache")
it("throws on quote() error", () => {
console.log("throws on quote() error - START");
const opts = { devel: "weirdJsonResult.fake.json" };
const promise = yf
.quoteCombine("fake", undefined, opts)
.finally(() => console.log("throws on quote() error - DONE"));
const promise = yf.quoteCombine("fake", undefined, opts);
jest.runAllTimers();
return expect(promise).rejects.toThrow(/Unexpected/);
});
Expand Down

0 comments on commit ba2ed67

Please sign in to comment.