-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use `e2e` and `test` to distinguish test types * Sort package.json * Use ahk2 main branch
- Loading branch information
1 parent
6730bb4
commit e064be6
Showing
12 changed files
with
63 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule ahk2
updated
from 9d6e81 to 02004d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import * as vscode from 'vscode'; | ||
import * as assert from 'assert'; | ||
import * as path from 'path'; | ||
import { documentToString } from './formattingProvider.utils'; | ||
|
||
suite('FormattingProvider utils', () => { | ||
// External tests use real VS Code behavior to ensure extension works end-to-end | ||
const externalDocumentToString = 'external documentToString'; | ||
suite(externalDocumentToString, () => { | ||
// Currently in `out` folder, need to get back to main `src` folder | ||
const filesParentPath = path.join( | ||
__dirname, // ./out/src/providers | ||
'..', // ./out/src | ||
'..', // ./out | ||
'..', // . | ||
'src', // ./src | ||
'providers', // ./src/providers | ||
'samples', // ./src/providers/samples | ||
); | ||
|
||
const myTests = [ | ||
{ filename: '1-one-empty-line.txt', expected: '' }, | ||
{ filename: '2-two-empty-lines.txt', expected: '\n' }, | ||
{ filename: '3-three-empty-lines.txt', expected: '\n\n' }, | ||
{ | ||
filename: '4-multiline-ends-with-newline.txt', | ||
expected: 'hello\nworld\nhow are you\n', | ||
}, | ||
{ | ||
filename: '5-multiline-no-newline.txt', | ||
expected: 'hello\nworld\nhow are you', | ||
}, | ||
{ | ||
filename: '6-single-line-ends-with-newline.txt', | ||
expected: 'hello\n', | ||
}, | ||
{ filename: '7-single-line-no-newline.txt', expected: 'hello' }, | ||
]; | ||
|
||
myTests.forEach((myTest) => | ||
test(myTest.filename, async () => { | ||
const vscodeDocument = await vscode.workspace.openTextDocument( | ||
path.join(filesParentPath, myTest.filename), | ||
); | ||
|
||
const actual = documentToString(vscodeDocument); | ||
|
||
assert.strictEqual(actual, myTest.expected); | ||
}), | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.