Skip to content

Commit

Permalink
core: fix sync tests and remove obsolete snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed Nov 16, 2024
1 parent c9ea9b1 commit 89ee0f8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 43 deletions.
2 changes: 0 additions & 2 deletions packages/core/__e2e__/__snapshots__/offers.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`get offer code > offer-code 1`] = `"123"`;

exports[`get offer code > offer-code 2`] = `"123"`;
18 changes: 0 additions & 18 deletions packages/core/__e2e__/__snapshots__/pricing.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@ exports[`get web pricing tier > get monthly web tier > monthly-web-pricing 1`] =
}
`;
exports[`get web pricing tier > get monthly web tier > yearly-ios-pricing 1`] = `
{
"country": Any<String>,
"countryCode": Any<String>,
"discount": Any<Number>,
"sku": Any<String>,
}
`;
exports[`get web pricing tier > get yearly web tier > yearly-web-pricing 1`] = `
{
"country": Any<String>,
Expand All @@ -81,15 +72,6 @@ exports[`get web pricing tier > get yearly web tier > yearly-web-pricing 1`] = `
}
`;
exports[`get yearly price > monthly-pricing 1`] = `
{
"country": Any<String>,
"countryCode": Any<String>,
"discount": Any<Number>,
"price": Any<Number>,
}
`;
exports[`get yearly price > yearly-pricing 1`] = `
{
"country": Any<String>,
Expand Down
25 changes: 2 additions & 23 deletions packages/core/__e2e__/sync.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import Database from "../src/api/index.ts";
import { NodeStorageInterface } from "../__mocks__/node-storage.mock.ts";
import { FS } from "../__mocks__/fs.mock.ts";
import Compressor from "../__mocks__/compressor.mock.js";
import { CHECK_IDS, EV, EVENTS } from "../src/common.ts";
import { EventSource } from "event-source-polyfill";
import { test, expect, vitest } from "vitest";
import { login } from "./utils.js";
import { SqliteDialect } from "@streetwriters/kysely";
import BetterSQLite3 from "better-sqlite3-multiple-ciphers";
import { databaseTest } from "../__tests__/utils/index.ts";

const TEST_TIMEOUT = 60 * 1000;

Expand Down Expand Up @@ -499,22 +493,7 @@ async function initializeDevice(id, capabilities = []) {
};
});

const device = new Database();
device.setup({
storage: new NodeStorageInterface(),
eventsource: EventSource,
fs: FS,
compressor: async () => Compressor,
sqliteOptions: {
dialect: (name) =>
new SqliteDialect({
database: BetterSQLite3(":memory:").unsafeMode(true)
})
},
batchSize: 500
});

await device.init();
const device = await databaseTest("memory");

await login(device);

Expand Down

0 comments on commit 89ee0f8

Please sign in to comment.