Skip to content

Commit

Permalink
FIX typos
Browse files Browse the repository at this point in the history
  • Loading branch information
pubkey committed Nov 1, 2022
1 parent df42e8c commit 00402ac
Show file tree
Hide file tree
Showing 27 changed files with 87 additions and 86 deletions.
1 change: 1 addition & 0 deletions config/codespellignore.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
statics
falsy
nin
shouldBe
10 changes: 5 additions & 5 deletions test/performance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('performance.test.ts', () => {
eventReduce: true,
/**
* A RxStorage implementation (like LokiJS)
* might need a full leader election cycle to be useable.
* might need a full leader election cycle to be usable.
* So we disable multiInstance here because it would make no sense
* to measure the leader election time instead of the database
* creation time.
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('performance.test.ts', () => {

/**
* Find by id,
* here we run the query agains the storage because
* here we run the query against the storage because
* if we would do collection.findByIds(), it would
* just return the documents from the cache.
*
Expand Down Expand Up @@ -186,12 +186,12 @@ export function averageOfTimeValues(
/**
* To better account for anomalies
* during time measurements,
* we strip the heighest x percent.
* we strip the highest x percent.
*/
stripHeighestXPercent: number
striphighestXPercent: number
): number {
times = times.sort((a, b) => a - b);
const stripAmount = Math.floor(times.length * (stripHeighestXPercent * 0.01));
const stripAmount = Math.floor(times.length * (striphighestXPercent * 0.01));
const useNumbers = times.slice(0, times.length - stripAmount);
let total = 0;
useNumbers.forEach(nr => total = total + nr);
Expand Down
4 changes: 2 additions & 2 deletions test/typings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('typings.test.js', function () {
};

config.parallel('basic', () => {
it('should sucess on basic test', async () => {
it('should success on basic test', async () => {
await transpileCode('console.log("Hello, world!")');
});
it('should fail on broken code', async () => {
Expand Down Expand Up @@ -369,7 +369,7 @@ describe('typings.test.js', function () {
`;
await transpileCode(code);
});
it('use underlaying pouchdb', async () => {
it('use underlying pouchdb', async () => {
const code = codeBase + `
(async() => {
const myDb: RxDatabase = await createRxDatabase({
Expand Down
14 changes: 7 additions & 7 deletions test/unit/attachments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ config.parallel('attachments.test.ts', () => {
base64StringNode
);
});
it('image attachment should be useable as img-element after base64<->Blob transformations', async function () {
it('image attachment should be usable as img-element after base64<->Blob transformations', async function () {
if (config.platform.isNode()) {
return;
}
Expand Down Expand Up @@ -460,7 +460,7 @@ config.parallel('attachments.test.ts', () => {
assert.strictEqual(data, 'foo bar aaa');
c.database.destroy();
});
it('should be able to render an encrytped stored image attachment', async () => {
it('should be able to render an encrypted stored image attachment', async () => {
if (config.platform.isNode()) {
return;
}
Expand Down Expand Up @@ -496,13 +496,13 @@ config.parallel('attachments.test.ts', () => {
type: 'text/plain'
});

const emited: any[] = [];
const emitted: any[] = [];
const sub = doc.allAttachments$
.subscribe((attachments: any[]) => emited.push(attachments));
await AsyncTestUtil.waitUntil(() => emited.length === 1);
.subscribe((attachments: any[]) => emitted.push(attachments));
await AsyncTestUtil.waitUntil(() => emitted.length === 1);

assert.strictEqual(emited[0].length, 1);
assert.ok(emited[0][0].doc);
assert.strictEqual(emitted[0].length, 1);
assert.ok(emitted[0][0].doc);

sub.unsubscribe();
c.database.destroy();
Expand Down
4 changes: 2 additions & 2 deletions test/unit/bug-report.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* this is a template for a test.
* If you found a bug, edit this test to reproduce it
* and than make a pull-request with that failing test.
* The maintainer will later move your test to the correct possition in the test-suite.
* The maintainer will later move your test to the correct position in the test-suite.
*
* To run this test do:
* - 'npm run test:node' so it runs in nodejs
Expand All @@ -22,7 +22,7 @@ describe('bug-report.test.js', () => {

/**
* If your test should only run in nodejs or only run in the browser,
* you should comment in the return operator and addapt the if statement.
* you should comment in the return operator and adapt the if statement.
*/
if (
!config.platform.isNode() // runs only in node
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cleanup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ config.parallel('cleanup.test.js', () => {
pull: {
async handler() {
await wait(50);
throw new Error('never sucess');
throw new Error('never success');
}
},
live: true
Expand Down
2 changes: 1 addition & 1 deletion test/unit/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export function setDefaultStorage(storageKey: string) {
/**
* We run the tests once together
* with a validation plugin
* to ensure we do not accidentially use non-valid data
* to ensure we do not accidentally use non-valid data
* in the tests.
*/
case 'memory-validation':
Expand Down
4 changes: 2 additions & 2 deletions test/unit/core.node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* this test checks if the core-module is useable without any plugins
* this is run in a seperate node-process via plugin.test.js
* this test checks if the core-module is usable without any plugins
* this is run in a separate node-process via plugin.test.js
*/

import assert from 'assert';
Expand Down
4 changes: 2 additions & 2 deletions test/unit/cross-instance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ config.parallel('cross-instance.test.js', () => {
});
describe('AutoPull', () => {
describe('positive', () => {
it('should recieve events on the other side', async () => {
it('should receive events on the other side', async () => {
const name = randomCouchString(10);
const c1 = await humansCollection.createMultiInstance(name);
const c2 = await humansCollection.createMultiInstance(name);
Expand All @@ -344,7 +344,7 @@ config.parallel('cross-instance.test.js', () => {
c1.database.destroy();
c2.database.destroy();
});
it('should recieve 2 events', async () => {
it('should receive 2 events', async () => {
const name = randomCouchString(10);
const c1 = await humansCollection.createMultiInstance(name);
const c2 = await humansCollection.createMultiInstance(name);
Expand Down
4 changes: 2 additions & 2 deletions test/unit/encryption.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ config.parallel('encryption.test.ts', () => {
const decrypted = decryptString(encrypted, 'mypw');
assert.deepStrictEqual(decrypted, value);
});
it('should encrypt and decrypt an extremly long string', () => {
it('should encrypt and decrypt an extremely long string', () => {
const value = randomCouchString(5000);
const pwd = 'pwd';
const encrypted = encryptString(value, pwd);
Expand All @@ -82,7 +82,7 @@ config.parallel('encryption.test.ts', () => {
assert.strictEqual(typeof encrypted, 'string');
assert.strictEqual(value, decrypted);
});
it('should encrypt and decrypt an extremly long password', () => {
it('should encrypt and decrypt an extremely long password', () => {
const value = 'foobar';
const pwd = randomCouchString(5000);
const encrypted = encryptString(value, pwd);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/event-reduce.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ describe('event-reduce.test.js', () => {
}
},
// TODO it should also work without the sorting
// because RxDB should add predicatble sort if primary not used in sorting
// because RxDB should add predictable sort if primary not used in sorting
sort: [{
passportId: 'asc'
}]
Expand Down
4 changes: 2 additions & 2 deletions test/unit/full.node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* this tests some basic behavior and then exits with zero-code
* this is run in a seperate node-process via plugin.test.js
* this is run in a separate node-process via plugin.test.js
*/

import assert from 'assert';
Expand Down Expand Up @@ -87,7 +87,7 @@ const run = async function () {
collection,
replicationIdentifier: 'my-custom-rest-replication',
live: true,
// use realy high values to ensure that the CI fails if the node process does not exit by itself.
// use really high values to ensure that the CI fails if the node process does not exit by itself.
retryTime: 50000,
pull: {
handler() {
Expand Down
14 changes: 7 additions & 7 deletions test/unit/key-compression.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ config.parallel('key-compression.test.js', () => {
createdAt: number;
read: boolean;
sender: string;
reciever: string;
receiver: string;
};
const schema: RxJsonSchema<RxMessageDocumentType> = {
title: 'messages schema',
Expand All @@ -255,15 +255,15 @@ config.parallel('key-compression.test.js', () => {
multipleOf: 1
},
read: {
description: 'true if was read by the reciever',
description: 'true if was read by the receiver',
type: 'boolean'
},
sender: {
type: 'string',
ref: 'users',
maxLength: 40
},
reciever: {
receiver: {
type: 'string',
ref: 'users',
maxLength: 40
Expand All @@ -277,7 +277,7 @@ config.parallel('key-compression.test.js', () => {
'createdAt',
'read',
'sender',
'reciever'
'receiver'
]
};

Expand All @@ -300,18 +300,18 @@ config.parallel('key-compression.test.js', () => {
createdAt: 100,
read: false,
sender: 'a',
reciever: 'b'
receiver: 'b'
});
const query = collection.findOne({
selector: {
$or: [
{
sender: 'a',
reciever: 'b'
receiver: 'b'
},
{
sender: 'b',
reciever: 'a'
receiver: 'a'
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion test/unit/local-documents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ config.parallel('local-documents.test.js', () => {
* was emitted. Otherwise we might miss the initial emit
* because creating the db2 can take a long time
* on some storages. So not awaiting here would make the test
* timing dependend.
* timing dependent.
*/
await waitUntil(() => emitted.length === 1);

Expand Down
4 changes: 2 additions & 2 deletions test/unit/pouch-db-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ config.parallel('pouch-db-integration.test.js', () => {
assert.strictEqual((x as any).length, 0);

/**
* If this test ever throws, it means we can remove the hacky workarround in
* If this test ever throws, it means we can remove the hacky workaround in
* src/plugins/in-memory.js
* Where we add the emitFlag to 'doNotEmitSet'
*/
Expand Down Expand Up @@ -522,7 +522,7 @@ config.parallel('pouch-db-integration.test.js', () => {
await AsyncTestUtil.wait(100);

/**
* If this test ever throws, it means we can remove the hacky workarround in
* If this test ever throws, it means we can remove the hacky workaround in
* src/plugins/in-memory.js
* Where we add the emitFlag to 'doNotEmitSet'
*/
Expand Down
22 changes: 11 additions & 11 deletions test/unit/query-builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ config.parallel('query-builder.test.js', () => {
const initialJson = builder.toJSON();
assert.deepStrictEqual(startQuery, initialJson.query);

// check builded json
// check built json
const builder2 = createQueryBuilder();
builder2
.where('age').gt(4)
.where('name').ne('alice')
.skip(startQuery.skip as number)
.limit(startQuery.limit as number)
.sort({ name: 'asc', lastname: 'desc' });
const buildedJson = builder2.toJSON();
assert.deepStrictEqual(startQuery, buildedJson.query);
const builtJson = builder2.toJSON();
assert.deepStrictEqual(startQuery, builtJson.query);
});
it('should work with only the selector', () => {
const startQuery: MangoQuery = {
Expand All @@ -63,13 +63,13 @@ config.parallel('query-builder.test.js', () => {
const initialJson = builder.toJSON();
assert.deepStrictEqual(startQuery, initialJson.query);

// check builded json
// check built json
const builder2 = createQueryBuilder();
builder2
.where('age').gt(5)
.where('name').ne('alice');
const buildedJson = builder2.toJSON();
assert.deepStrictEqual(startQuery, buildedJson.query);
const builtJson = builder2.toJSON();
assert.deepStrictEqual(startQuery, builtJson.query);
});
it('should have path', () => {
const path = 'foobar';
Expand All @@ -78,8 +78,8 @@ config.parallel('query-builder.test.js', () => {
.where('age').gt(6)
.where('name').ne('alice')
.where(path);
const buildedJson = builder2.toJSON();
assert.strictEqual(buildedJson.path, path);
const builtJson = builder2.toJSON();
assert.strictEqual(builtJson.path, path);
});
it('should work with big equal number', () => {
const startQuery: MangoQuery = {
Expand All @@ -95,14 +95,14 @@ config.parallel('query-builder.test.js', () => {
const initialJson = builder.toJSON();
assert.deepStrictEqual(startQuery, initialJson.query);

// check builded json
// check built json
const builder2 = createQueryBuilder();
builder2
.where('age')
.gt(-9999999999999999999999999999)
.sort('age');
const buildedJson = builder2.toJSON();
assert.deepStrictEqual(startQuery, buildedJson.query);
const builtJson = builder2.toJSON();
assert.deepStrictEqual(startQuery, builtJson.query);
});

});
Expand Down
2 changes: 1 addition & 1 deletion test/unit/query-planner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ config.parallel('query-planner.test.js', () => {
);
assert.deepStrictEqual(queryPlan.index, ['age', 'firstName', 'passportId']);
});
it('should prefer the index that matches the sort order, if selector for both fiels is used', () => {
it('should prefer the index that matches the sort order, if selector for both fields is used', () => {
const schema = getHumanSchemaWithIndexes([
['firstName', 'age'],
['age', 'firstName']
Expand Down
2 changes: 1 addition & 1 deletion test/unit/reactive-query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ config.parallel('reactive-query.test.js', () => {
assert.strictEqual(last.state.providers, 9);

// on own collection, all events should have propagated
// TODO this fails for unkonwn reason on slow device
// TODO this fails for unknown reason on slow device
// assert.strictEqual(emittedOwn.length, 10);

sub.unsubscribe();
Expand Down
Loading

0 comments on commit 00402ac

Please sign in to comment.