Skip to content

Commit

Permalink
fix: emphasize no async fns on the describeWS Test functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanyeung committed Feb 9, 2022
1 parent 562f2bd commit 9d7cf5f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ suite("windowDecorations", function () {
});
});

describeSingleWS("AND frontmatter is not visible", { ctx }, async () => {
describeSingleWS("AND frontmatter is not visible", { ctx }, () => {
before(async () => {
const { wsRoot, vaults, engine } = ExtensionProvider.getDWorkspace();
const note = await NoteTestUtilsV4.createNoteWithEngine({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ suite("MigrationService", function () {
ctx,
preSetupHook: ENGINE_HOOKS.setupBasic,
},
async () => {
() => {
const dummyFunc: MigrateFunction = async ({
dendronConfig,
wsConfig,
Expand Down
24 changes: 19 additions & 5 deletions packages/plugin-core/src/test/testUtilsV3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ export function runSuiteButSkipForWindows() {
return runTest;
}

/** Use to run tests with a multi-vault workspace. Used in the same way as regular `describe`.
*
* For example:
/**
* Use to run tests with a multi-vault workspace. Used in the same way as
* regular `describe`. For example:
* ```ts
* describeMultiWS(
* "WHEN workspace type is not specified",
Expand All @@ -455,11 +455,16 @@ export function runSuiteButSkipForWindows() {
* }
* );
* ```
* @param title
* @param opts
* @param fn - the test() functions to execute. NOTE: This function CANNOT be
* async, or else the test may not fail reliably when your expect or assert
* conditions are not met.
*/
export function describeMultiWS(
title: string,
opts: SetupLegacyWorkspaceMultiOpts,
fn: () => any
fn: () => void
) {
describe(title, () => {
before(async () => {
Expand All @@ -476,10 +481,19 @@ export function describeMultiWS(
});
}

/**
* Use to run tests with a single-vault workspace. Used in the same way as
* regular `describe`.
* @param title
* @param opts
* @param fn - the test() functions to execute. NOTE: This function CANNOT be
* async, or else the test may not fail reliably when your expect or assert
* conditions are not met.
*/
export function describeSingleWS(
title: string,
opts: SetupLegacyWorkspaceOpts,
fn: () => any
fn: () => void
) {
describe(title, () => {
before(async () => {
Expand Down

0 comments on commit 9d7cf5f

Please sign in to comment.