Skip to content

Commit

Permalink
Update UI tests to propagate test failures up to the caller.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAnson committed Nov 24, 2023
1 parent 6844f84 commit 80776fd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
9 changes: 4 additions & 5 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class FsWrapper {
] = nameAndType;
return options.withFileTypes ?
{
/* eslint-disable multiline-ternary, no-bitwise */
/* eslint-disable no-bitwise */
"isBlockDevice": FsWrapper.fwFalse,
"isCharacterDevice": FsWrapper.fwFalse,
"isDirectory": (fileType & vscode.FileType.Directory) ? FsWrapper.fwTrue : FsWrapper.fwFalse,
Expand All @@ -198,7 +198,7 @@ class FsWrapper {
"isSocket": FsWrapper.fwFalse,
"isSymbolicLink":
(fileType & vscode.FileType.SymbolicLink) ? FsWrapper.fwTrue : FsWrapper.fwFalse,
/* eslint-enable multiline-ternary, no-bitwise */
/* eslint-enable no-bitwise */
name
} :
name;
Expand Down Expand Up @@ -231,7 +231,7 @@ class FsWrapper {
).then(
(fileStat) => {
// Stub required properties for fast-glob
/* eslint-disable dot-notation, multiline-ternary, no-bitwise */
/* eslint-disable dot-notation, no-bitwise */
fileStat["isBlockDevice"] = FsWrapper.fwFalse;
fileStat["isCharacterDevice"] = FsWrapper.fwFalse;
fileStat["isDirectory"] = (fileStat.type & vscode.FileType.Directory) ? FsWrapper.fwTrue : FsWrapper.fwFalse;
Expand All @@ -240,7 +240,7 @@ class FsWrapper {
fileStat["isSocket"] = FsWrapper.fwFalse;
fileStat["isSymbolicLink"] =
(fileStat.type & vscode.FileType.SymbolicLink) ? FsWrapper.fwTrue : FsWrapper.fwFalse;
/* eslint-enable dot-notation, multiline-ternary, no-bitwise */
/* eslint-enable dot-notation, no-bitwise */
callback(null, fileStat);
},
callback
Expand Down Expand Up @@ -337,7 +337,6 @@ async function getConfig (fs, configuration, uri) {
(workspaceFolderUri.scheme !== schemeFile);
const homedir = os && os.homedir && os.homedir();
const workspaceFolderFsPath = posixPath(workspaceFolderUri.fsPath);
// eslint-disable-next-line multiline-ternary
const extendBase = ((useHomedir && homedir) ? homedir : workspaceFolderFsPath) || "";
let expanded = expandTildePath(userWorkspaceConfig.extends, os);
if (homedir) {
Expand Down
8 changes: 1 addition & 7 deletions test/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ function run () {
return tests.reduce((previous, current) => previous.then(() => {
// eslint-disable-next-line no-console
console.log(`- ${current.name}...`);
return current()
.then(
// eslint-disable-next-line no-console
() => console.log("- ok"),
// eslint-disable-next-line no-console
(error) => console.log(`- FAIL: ${error}`)
);
return current();
}), Promise.resolve());
}

Expand Down
1 change: 0 additions & 1 deletion test/tests.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ function openLintEditVerifyFixAll () {
const [ uri ] = uris;
const diagnostics = vscode.languages.getDiagnostics(uri);
if ((diagnostics.length > 0) && !fixedAll) {
// eslint-disable-next-line array-element-newline
const [ md019, md012 ] = diagnostics;
// @ts-ignore
assert.equal(md019.code.value, "MD019");
Expand Down

0 comments on commit 80776fd

Please sign in to comment.