Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 4183e39

Browse files
committed
Add tests
1 parent e89c100 commit 4183e39

File tree

5 files changed

+37
-2
lines changed

5 files changed

+37
-2
lines changed

src/_tests/fixtures/49639/_files.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"c5e5c9885d23e7d1c1ea8f54b53c8283d5f4f856:types/jasmine/tsconfig.json": "{\n \"files\": [\n \"index.d.ts\",\n \"jasmine-tests.ts\"\n ],\n \"compilerOptions\": {\n \"module\": \"commonjs\",\n \"lib\": [\n \"es6\",\n \"dom\"\n ],\n \"noImplicitAny\": true,\n \"noImplicitThis\": true,\n \"strictNullChecks\": true,\n \"baseUrl\": \"../\",\n \"typeRoots\": [\n \"../\"\n ],\n \"types\": [],\n \"noEmit\": true,\n \"forceConsistentCasingInFileNames\": true\n }\n}\n",
3+
"master:types/jasmine/tsconfig.json": "{\n \"files\": [\n \"index.d.ts\",\n \"jasmine-tests.ts\"\n ],\n \"compilerOptions\": {\n \"module\": \"commonjs\",\n \"lib\": [\n \"es6\",\n \"dom\"\n ],\n \"noImplicitAny\": true,\n \"noImplicitThis\": true,\n \"strictNullChecks\": true,\n \"strictFunctionTypes\": false,\n \"baseUrl\": \"../\",\n \"typeRoots\": [\n \"../\"\n ],\n \"types\": [],\n \"noEmit\": true,\n \"forceConsistentCasingInFileNames\": true\n }\n}\n",
24
"c5e5c9885d23e7d1c1ea8f54b53c8283d5f4f856:types/jasmine/tslint.json": "{\n \"extends\": \"dtslint/dt.json\",\n \"rules\": {\n \"await-promise\": false,\n \"ban-types\": false,\n \"no-declare-current-package\": false,\n \"no-empty-interface\": false,\n \"no-single-declare-module\": false,\n \"no-unnecessary-generics\": false,\n \"no-var-keyword\": false,\n \"one-variable-per-declaration\": false,\n \"only-arrow-functions\": false\n }\n}\n",
35
"master:types/jasmine/tslint.json": "{\n \"extends\": \"dtslint/dt.json\",\n \"rules\": {\n \"ban-types\": false,\n \"no-declare-current-package\": false,\n \"no-empty-interface\": false,\n \"no-single-declare-module\": false,\n \"no-unnecessary-generics\": false,\n \"no-var-keyword\": false,\n \"one-variable-per-declaration\": false,\n \"only-arrow-functions\": false\n }\n}\n",
46
"master:types/jasmine/index.d.ts": "// Type definitions for Jasmine 3.6\n// Project: http://jasmine.github.io\n// Definitions by: Boris Yankov <https://github.com/borisyankov>\n// Theodore Brown <https://github.com/theodorejb>\n// David Pärsson <https://github.com/davidparsson>\n// Gabe Moothart <https://github.com/gmoothart>\n// Lukas Zech <https://github.com/lukas-zech-software>\n// Boris Breuer <https://github.com/Engineer2B>\n// Chris Yungmann <https://github.com/cyungmann>\n// Giles Roadnight <https://github.com/Roaders>\n// Yaroslav Admin <https://github.com/devoto13>\n// Domas Trijonis <https://github.com/fdim>\n// Moshe Kolodny <https://github.com/kolodny>\n// Stephen Farrar <https://github.com/stephenfarrar>\n// Alex Povar <https://github.com/zvirja>\n// Dominik Ehrenberg <https://github.com/djungowski>\n// Chives <https://github.com/chivesrs>\n// kirjs <https://github.com/kirjs>\n// Md. Enzam Hossain <https://github.com/ienzam>\n// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\n\n// For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts\n\n/**\n * @deprecated Use {@link jasmine.ImplementationCallback} instead.\n */\ntype ImplementationCallback = jasmine.ImplementationCallback;\n\n/**\n * Create a group of specs (often called a suite).\n * @param description Textual description of the group\n * @param specDefinitions Function for Jasmine to invoke that will define inner suites a specs\n */\ndeclare function describe(description: string, specDefinitions: () => void): void;\n\n/**\n * A focused `describe`. If suites or specs are focused, only those that are focused will be executed.\n * @param description Textual description of the group\n * @param specDefinitions Function for Jasmine to invoke that will define inner suites a specs\n */\ndeclare function fdescribe(description: string, specDefinitions: () => void): void;\n\n/**\n * A temporarily disabled `describe`. Specs within an xdescribe will be marked pending and not executed.\n * @param description Textual description of the group\n * @param specDefinitions Function for Jasmine to invoke that will define inner suites a specs\n */\ndeclare function xdescribe(description: string, specDefinitions: () => void): void;\n\n/**\n * Define a single spec. A spec should contain one or more expectations that test the state of the code.\n * A spec whose expectations all succeed will be passing and a spec with any failures will fail.\n * @param expectation Textual description of what this spec is checking\n * @param assertion Function that contains the code of your test. If not provided the test will be pending.\n * @param timeout Custom timeout for an async spec.\n */\ndeclare function it(expectation: string, assertion?: jasmine.ImplementationCallback, timeout?: number): void;\n\n/**\n * A focused `it`. If suites or specs are focused, only those that are focused will be executed.\n * @param expectation Textual description of what this spec is checking\n * @param assertion Function that contains the code of your test. If not provided the test will be pending.\n * @param timeout Custom timeout for an async spec.\n */\ndeclare function fit(expectation: string, assertion?: jasmine.ImplementationCallback, timeout?: number): void;\n\n/**\n * A temporarily disabled `it`. The spec will report as pending and will not be executed.\n * @param expectation Textual description of what this spec is checking\n * @param assertion Function that contains the code of your test. If not provided the test will be pending.\n * @param timeout Custom timeout for an async spec.\n */\ndeclare function xit(expectation: string, assertion?: jasmine.ImplementationCallback, timeout?: number): void;\n\n/**\n * Mark a spec as pending, expectation results will be ignored.\n * If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending.\n * @param reason Reason the spec is pending.\n */\ndeclare function pending(reason?: string): void;\n\n/**\n * Sets a user-defined property that will be provided to reporters as\n * part of the properties field of SpecResult.\n * @since 3.6.0\n */\ndeclare function setSpecProperty(key: string, value: unknown): void;\n\n/**\n * Sets a user-defined property that will be provided to reporters as\n * part of the properties field of SuiteResult.\n * @since 3.6.0\n */\ndeclare function setSuiteProperty(key: string, value: unknown): void;\n\n/**\n * Run some shared setup before each of the specs in the describe in which it is called.\n * @param action Function that contains the code to setup your specs.\n * @param timeout Custom timeout for an async beforeEach.\n */\ndeclare function beforeEach(action: jasmine.ImplementationCallback, timeout?: number): void;\n\n/**\n * Run some shared teardown after each of the specs in the describe in which it is called.\n * @param action Function that contains the code to teardown your specs.\n * @param timeout Custom timeout for an async afterEach.\n */\ndeclare function afterEach(action: jasmine.ImplementationCallback, timeout?: number): void;\n\n/**\n * Run some shared setup once before all of the specs in the describe are run.\n * Note: Be careful, sharing the setup from a beforeAll makes it easy to accidentally leak state between your specs so that they erroneously pass or fail.\n * @param action Function that contains the code to setup your specs.\n * @param timeout Custom timeout for an async beforeAll.\n */\ndeclare function beforeAll(action: jasmine.ImplementationCallback, timeout?: number): void;\n\n/**\n * Run some shared teardown once before all of the specs in the describe are run.\n * Note: Be careful, sharing the teardown from a afterAll makes it easy to accidentally leak state between your specs so that they erroneously pass or fail.\n * @param action Function that contains the code to teardown your specs.\n * @param timeout Custom timeout for an async afterAll\n */\ndeclare function afterAll(action: jasmine.ImplementationCallback, timeout?: number): void;\n\n/**\n * Create an expectation for a spec.\n * @checkReturnValue see https://tsetse.info/check-return-value\n * @param spy\n */\ndeclare function expect<T extends jasmine.Func>(spy: T | jasmine.Spy<T>): jasmine.FunctionMatchers<T>;\n\n/**\n * Create an expectation for a spec.\n * @checkReturnValue see https://tsetse.info/check-return-value\n * @param actual\n */\ndeclare function expect<T>(actual: ArrayLike<T>): jasmine.ArrayLikeMatchers<T>;\n\n/**\n * Create an expectation for a spec.\n * @checkReturnValue see https://tsetse.info/check-return-value\n * @param actual Actual computed value to test expectations against.\n */\ndeclare function expect<T>(actual: T): jasmine.Matchers<T>;\n\n/**\n * Create an expectation for a spec.\n */\ndeclare function expect(): jasmine.NothingMatcher;\n\n/**\n * Create an asynchronous expectation for a spec. Note that the matchers\n * that are provided by an asynchronous expectation all return promises\n * which must be either returned from the spec or waited for using `await`\n * in order for Jasmine to associate them with the correct spec.\n * @checkReturnValue see https://tsetse.info/check-return-value\n * @param actual Actual computed value to test expectations against.\n */\ndeclare function expectAsync<T, U>(actual: T|PromiseLike<T>): jasmine.AsyncMatchers<T, U>;\n\n/**\n * Explicitly mark a spec as failed.\n * @param e Reason for the failure\n */\ndeclare function fail(e?: any): void;\n\n/**\n * Action method that should be called when the async work is complete.\n */\ninterface DoneFn extends Function {\n (): void;\n\n /** fails the spec and indicates that it has completed. If the message is an Error, Error.message is used */\n fail: (message?: Error | string) => void;\n}\n\n/**\n * Install a spy onto an existing object.\n * @param object The object upon which to install the `Spy`.\n * @param method The name of the method to replace with a `Spy`.\n */\ndeclare function spyOn<T, K extends keyof T = keyof T>(\n object: T, method: T[K] extends Function ? K : never,\n): jasmine.Spy<\n T[K] extends jasmine.Func ? T[K] :\n T[K] extends { new (...args: infer A): infer V } ? (...args: A) => V :\n never\n>;\n\n/**\n * Install a spy on a property installed with `Object.defineProperty` onto an existing object.\n * @param object The object upon which to install the `Spy`.\n * @param property The name of the property to replace with a `Spy`.\n * @param accessType The access type (get|set) of the property to `Spy` on.\n */\ndeclare function spyOnProperty<T>(object: T, property: keyof T, accessType?: 'get' | 'set'): jasmine.Spy;\n\n/**\n * Installs spies on all writable and configurable properties of an object.\n * @param object The object upon which to install the `Spy`s.\n */\ndeclare function spyOnAllFunctions<T>(object: T): jasmine.SpyObj<T>;\n\ndeclare function runs(asyncMethod: Function): void;\ndeclare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void;\ndeclare function waits(timeout?: number): void;\n\ndeclare namespace jasmine {\n type Func = (...args: any[]) => any;\n\n // Use trick with prototype to allow abstract classes.\n // More info: https://stackoverflow.com/a/38642922/2009373\n type Constructor = Function & { prototype: any };\n\n type ImplementationCallback = (() => PromiseLike<any>) | (() => void) | ((done: DoneFn) => void);\n\n type ExpectedRecursive<T> = T | ObjectContaining<T> | AsymmetricMatcher<any> | {\n [K in keyof T]: ExpectedRecursive<T[K]> | Any;\n };\n type Expected<T> = T | ObjectContaining<T> | AsymmetricMatcher<any> | Any | Spy | {\n [K in keyof T]: ExpectedRecursive<T[K]>;\n };\n type SpyObjMethodNames<T = undefined> =\n T extends undefined ?\n (ReadonlyArray<string> | { [methodName: string]: any }) :\n (ReadonlyArray<keyof T> | { [P in keyof T]?: T[P] extends Func ? ReturnType<T[P]> : any });\n\n type SpyObjPropertyNames<T = undefined> =\n T extends undefined ?\n (ReadonlyArray<string> | { [propertyName: string]: any }) :\n (Readonly",

src/_tests/fixtures/49639/_response.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,12 @@
439439
"deletions": 13,
440440
"__typename": "PullRequestChangedFile"
441441
},
442+
{
443+
"path": "types/jasmine/tsconfig.json",
444+
"additions": 0,
445+
"deletions": 1,
446+
"__typename": "PullRequestChangedFile"
447+
},
442448
{
443449
"path": "types/jasmine/tslint.json",
444450
"additions": 1,

src/_tests/fixtures/49639/derived.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020
"path": "types/jasmine/index.d.ts",
2121
"kind": "definition"
2222
},
23+
{
24+
"path": "types/jasmine/tsconfig.json",
25+
"kind": "package-meta",
26+
"suspect": "not the required form and not moving towards it",
27+
"suggestion": {
28+
"startLine": 21,
29+
"endLine": 21,
30+
"body": " \"forceConsistentCasingInFileNames\": true,\n \"strictFunctionTypes\": true\n"
31+
}
32+
},
2333
{
2434
"path": "types/jasmine/tslint.json",
2535
"kind": "package-meta",

src/_tests/fixtures/49639/mutations.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,18 @@
3636
"variables": {
3737
"input": {
3838
"id": "MDEyOklzc3VlQ29tbWVudDcyOTI0NjE3Mw==",
39-
"body": "@ienzam Thank you for submitting this PR!\n\n***This is a live comment which I will keep updated.***\n\nThis PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Have you considered [adding tests](https://github.com/DefinitelyTyped/DefinitelyTyped#editing-tests-on-an-existing-package) to cover the change you're making? Including tests allows this PR to be merged by yourself and the owners of this module. This can potentially save days of time for you.\n\n## 1 package in this PR\n\n* `jasmine` [on npm](https://www.npmjs.com/package/jasmine), [on unpkg](https://unpkg.com/browse/jasmine@latest/) (author is owner)\n - owner-approval: @chivesrs\n\n## Code Reviews\n\nBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged.\n\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * ❌ A DT maintainer needs to approve changes which affect module config files\n - [`jasmine/tslint.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49639/files/c5e5c9885d23e7d1c1ea8f54b53c8283d5f4f856#diff-0a3e03c56e43fc53245f1e4296782b62788ba4c9e70c9439d22b1998e681f55e): not the required form and not moving towards it\n\nOnce every item on this list is checked, I'll ask you for permission to merge and publish the changes.\n\n----------------------\n... diagnostics scrubbed ...\n<!--typescript_bot_welcome-->"
39+
"body": "@ienzam Thank you for submitting this PR!\n\n***This is a live comment which I will keep updated.***\n\nThis PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Have you considered [adding tests](https://github.com/DefinitelyTyped/DefinitelyTyped#editing-tests-on-an-existing-package) to cover the change you're making? Including tests allows this PR to be merged by yourself and the owners of this module. This can potentially save days of time for you.\n\n## 1 package in this PR\n\n* `jasmine` [on npm](https://www.npmjs.com/package/jasmine), [on unpkg](https://unpkg.com/browse/jasmine@latest/) (author is owner)\n - owner-approval: @chivesrs\n\n## Code Reviews\n\nBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged.\n\n## Status\n\n * ✅ No merge conflicts\n * ✅ Continuous integration tests have passed\n * ❌ A DT maintainer needs to approve changes which affect module config files\n - [`jasmine/tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49639/files/c5e5c9885d23e7d1c1ea8f54b53c8283d5f4f856#diff-522bbd567aec6bfd3e2cd29af157310bd47eb79dbe6a670beb4da4e1a14d0f2d): not the required form and not moving towards it\n - [`jasmine/tslint.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49639/files/c5e5c9885d23e7d1c1ea8f54b53c8283d5f4f856#diff-0a3e03c56e43fc53245f1e4296782b62788ba4c9e70c9439d22b1998e681f55e): not the required form and not moving towards it\n\nOnce every item on this list is checked, I'll ask you for permission to merge and publish the changes.\n\n----------------------\n... diagnostics scrubbed ...\n<!--typescript_bot_welcome-->"
40+
}
41+
}
42+
},
43+
{
44+
"query": "mutation($input: AddPullRequestReviewThreadInput!) { addPullRequestReviewThread(input: $input) { clientMutationId } }",
45+
"variables": {
46+
"input": {
47+
"pullRequestId": "MDExOlB1bGxSZXF1ZXN0NTIyNzM5MjUx",
48+
"path": "types/jasmine/tsconfig.json",
49+
"line": 21,
50+
"body": "```suggestion\n \"forceConsistentCasingInFileNames\": true,\n \"strictFunctionTypes\": true\n"
4051
}
4152
}
4253
},

0 commit comments

Comments
 (0)