Skip to content

Commit

Permalink
Merge pull request #64 from scottc/module-import
Browse files Browse the repository at this point in the history
Fix @types/superagent has no default export
  • Loading branch information
mtennoe committed Mar 12, 2019
2 parents 6b8c98d + 80775e1 commit ab30754
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 10 additions & 5 deletions __tests__/__snapshots__/runner.js.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Real world: Uber 1`] = `
"import request, {
"import * as request from \\"superagent\\";
import {
SuperAgentStatic,
SuperAgentRequest,
Response
Expand Down Expand Up @@ -703,7 +704,8 @@ export default UberApi;"
`;

exports[`Real world: petshop 1`] = `
"import request, {
"import * as request from \\"superagent\\";
import {
SuperAgentStatic,
SuperAgentRequest,
Response
Expand Down Expand Up @@ -2204,7 +2206,8 @@ export default PetshopApi;"
`;

exports[`Real world: users 1`] = `
"import request, {
"import * as request from \\"superagent\\";
import {
SuperAgentStatic,
SuperAgentRequest,
Response
Expand Down Expand Up @@ -2459,7 +2462,8 @@ export default UsersApi;"
`;

exports[`Should resolve protected api 1`] = `
"import request, {
"import * as request from \\"superagent\\";
import {
SuperAgentStatic,
SuperAgentRequest,
Response
Expand Down Expand Up @@ -2772,7 +2776,8 @@ export default ProtectedApi;"
`;

exports[`Should resolve references 1`] = `
"import request, {
"import * as request from \\"superagent\\";
import {
SuperAgentStatic,
SuperAgentRequest,
Response
Expand Down
3 changes: 2 additions & 1 deletion templates/class.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
/// <reference path="{{&.}}" />
{{/imports}}

import request, { SuperAgentStatic, SuperAgentRequest, Response } from "superagent";
import * as request from "superagent";
import { SuperAgentStatic, SuperAgentRequest, Response } from "superagent";

export type RequestHeaders = {
[header: string]: string;
Expand Down

0 comments on commit ab30754

Please sign in to comment.