Skip to content

Commit

Permalink
test: use normal naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Aug 7, 2024
1 parent 659e490 commit 0245156
Show file tree
Hide file tree
Showing 55 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .sfdevrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"test": {
"testsPath": "test/**/*Test.ts"
"testsPath": "test/unit/**/*.test.ts"
},
"wireit": {
"compile": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"output": []
},
"test:only": {
"command": "nyc mocha \"test/**/*Test.ts\"",
"command": "nyc mocha \"test/unit/**/*.test.ts\"",
"env": {
"FORCE_COLOR": "2"
},
Expand Down Expand Up @@ -182,4 +182,4 @@
"command": "tsc -p typedocExamples"
}
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('TTLConfig', () => {
it('should return the latest entry', async () => {
const config = await TestConfig.create();
config.set('1', { one: 'one' });
await sleep(1000);
await sleep(200);
config.set('2', { two: 'two' });
const latest = config.getLatestEntry();
expect(latest).to.deep.equal(['2', config.get('2')]);
Expand All @@ -68,7 +68,7 @@ describe('TTLConfig', () => {
it('should return the key of the latest entry', async () => {
const config = await TestConfig.create();
config.set('1', { one: 'one' });
await sleep(1000);
await sleep(200);
config.set('2', { two: 'two' });
const latest = config.getLatestKey();
expect(latest).to.equal('2');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions test/unit/loggerTest.ts → test/unit/logger/logger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

import { expect, config as chaiConfig } from 'chai';
import { isString } from '@salesforce/ts-types';
import { Logger, LoggerLevel, computeLevel } from '../../src/logger/logger';
import { shouldThrowSync, TestContext } from '../../src/testSetup';
import { Logger, LoggerLevel, computeLevel } from '../../../src/logger/logger';
import { shouldThrowSync, TestContext } from '../../../src/testSetup';

// NOTE: These tests still use 'await' which is how it use to work and were left to make
// sure we didn't regress the way they were used.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions test/unit/sfErrorTest.ts → test/unit/sfError.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ describe('SfError', () => {
it('returned `name:message` when no cause', () => {
const err = new SfError('test');
expect(inspect(err)).to.include('SfError: test');
expect(inspect(err)).to.include('sfErrorTest.ts');
expect(inspect(err)).to.include('sfError.test.ts');
// there's always 1 cause from the `cause:` property, even if undefined
expect(inspect(err)?.match(causeRegex)).to.have.lengthOf(1);
});
it('1 cause', () => {
const nestedError = new Error('nested');
const err = new SfError('test', undefined, undefined, nestedError);
expect(inspect(err)).to.include('SfError: test');
expect(inspect(err)).to.include('sfErrorTest.ts');
expect(inspect(err)).to.include('sfError.test.ts');
expect(inspect(err)).to.include('nested');
expect(inspect(err)?.match(causeRegex)).to.have.lengthOf(1);
expect(inspect(err)?.match(nestedCauseRegex)).to.be.null;
Expand All @@ -97,7 +97,7 @@ describe('SfError', () => {
const nestedError2 = new Error('nested2', { cause: nestedError });
const err = new SfError('test', undefined, undefined, nestedError2);
expect(inspect(err)).to.include('SfError: test');
expect(inspect(err)).to.include('sfErrorTest.ts');
expect(inspect(err)).to.include('sfError.test.ts');
expect(inspect(err)).to.include('nested');
expect(inspect(err)).to.include('nested2');
expect(inspect(err)?.match(causeRegex)).to.have.lengthOf(1);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0245156

Please sign in to comment.