Skip to content

Commit

Permalink
Add examples + launch configuration, so that it is easier to test reg…
Browse files Browse the repository at this point in the history
…ression (#331)

* Add examples + launch configuration, so that it is easier to test this repository
  • Loading branch information
domsleee authored Oct 10, 2023
1 parent e3f7c76 commit 81f0bac
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@
"outFiles": [ "${workspaceRoot}/dist/*.js" ],
"preLaunchTask": "npm: build"
},
{
"name": "Extension examples",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"--folder-uri=${workspaceRoot}/examples",
"--file-uri=${workspaceRoot}/examples/examples.test.ts"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [ "${workspaceRoot}/dist/*.js" ],
"preLaunchTask": "npm: build"
},
{
"name": "Extension Tests",
"type": "extensionHost",
Expand Down
78 changes: 78 additions & 0 deletions examples/examples.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
describe('Example tests', () => {
it('test with ', () => {
expect(true);
});

it("test with ' single quote", () => {
expect(true);
});

it('test with " double quote', () => {
expect(true);
});

it('test with () parenthesis', () => {
expect(true);
});

it('test with [ square bracket', () => {
expect(true);
});

it(`test with
lf`, () => {
expect(true);
});

it(`test with \nmanual lf`, () => {
expect(true);
});

it(`test with \r\nmanual crlf`, () => {
expect(true);
});

it('test with %var%', () => {
expect(true);
});

const v = 'interpolated string';
it(`test with ${v}`, () => {
expect(true);
});

it('test with $var', () => {
expect(true);
});

it('test with `backticks`', () => {
expect(true);
});

it('test with regex .*$^|[]', () => {
expect(true);
});
});

// #311
it.each([1, 2])('test with generated %i', (id) => {
expect(true);
});

describe('nested', () => {
describe('a', () => {
it('b', () => {
expect(true);
});
});
});

// #299
class TestClass {
myFunction() {
// nothing
}
}
it(TestClass.prototype.myFunction.name, () => {
expect(true).toBe(true);
});
4 changes: 4 additions & 0 deletions examples/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"exclude": [
"node_modules",
".vscode-test"
".vscode-test",
"examples"
]
}

0 comments on commit 81f0bac

Please sign in to comment.