Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: type directives import #2910

Merged
merged 7 commits into from Sep 11, 2019

Conversation

@bartlomieju
Copy link
Contributor

commented Sep 10, 2019

Fixes #2909

I'm not sure about the test though

CC @kitsonk

js/type_directives.ts Outdated Show resolved Hide resolved
js/type_directives.ts Outdated Show resolved Hide resolved
tests/type_definitions.ts Show resolved Hide resolved
bartlomieju added 3 commits Sep 10, 2019
Copy link
Contributor

left a comment

LGTM

@axetroy

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2019

Should we add test cases to ensure that the parsing of the directives is correct?

eg.

interface TestCase {
  input: string;
  output?: DirectiveInfo;
  error?: string;
}

test(() => {
  // defined testcase
  const testcases = [
    {
      input: "// some typescript code",
      output: undefined
    },
    {
      input: `// @deno-types="./foo.d.ts"`,
      output: {
        path: "...",
        start: 0,
        end: 0
      }
    }
  ];

  for (const testcase of testcases) {
    // run parser function
  }
});
@kitsonk

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2019

@axetroy at the moment we don't have unit tests for the compiler and related modules, mostly because they have no run-time presence to access via the unit tests... we are getting to the point though where that will become possible to load the modules in the runtime and unit test them, but I see adding (actually restoring) that functionality to be seperate from this PR.

@ry
ry approved these changes Sep 11, 2019
Copy link
Collaborator

left a comment

LGTM

@ry ry merged commit a4e1d7d into denoland:master Sep 11, 2019
3 checks passed
3 checks passed
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla Contributor License Agreement is signed.
Details
@bartlomieju bartlomieju deleted the bartlomieju:fix-type_directives_import branch Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.