core: fix sync tests and remove obsolete snapshots

This commit is contained in:
Abdullah Atta
2024-11-16 15:16:13 +05:00
parent c9ea9b1d4e
commit 89ee0f8d27
3 changed files with 2 additions and 43 deletions

View File

@@ -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"`;

View File

@@ -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>,
@@ -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>,

View File

@@ -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;
@@ -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);