Skip to content

Commit

Permalink
Test generics in object methods in TypeScript
Browse files Browse the repository at this point in the history
as proposed by @j-f1 in the following PR: #5824

should validate that issue #5817 does not reappear

this change closes #5817 as resolved and tested

this change closes #5824 (PR #5824) as superseded

Co-authored-by: Jed Fox <git@twopointzero.us>
Co-authored-by: Christopher J. Brody <chris@brody.consulting>
  • Loading branch information
Christopher J. Brody and j-f1 committed Apr 4, 2019
1 parent dcaed91 commit 716b8b4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/typescript_generic/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`object-method.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
export default {
load<K, T>(k: K, t: T) {
return {k, t};
}
}
=====================================output=====================================
export default {
load<K, T>(k: K, t: T) {
return { k, t };
}
};
================================================================================
`;
1 change: 1 addition & 0 deletions tests/typescript_generic/jsfmt.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
run_spec(__dirname, ["typescript"]);
5 changes: 5 additions & 0 deletions tests/typescript_generic/object-method.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
load<K, T>(k: K, t: T) {
return {k, t};
}
}

0 comments on commit 716b8b4

Please sign in to comment.