Skip to content

Commit

Permalink
Test generics in object methods in TypeScript (#5989)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Brody authored and duailibe committed Apr 8, 2019
1 parent 4d6ce37 commit 6ae4106
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 6ae4106

Please sign in to comment.