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

Typescript files (.ts) are marked as binary files #990

Closed
ondrejsevcik opened this issue Mar 26, 2014 · 8 comments
Closed

Typescript files (.ts) are marked as binary files #990

ondrejsevcik opened this issue Mar 26, 2014 · 8 comments

Comments

@ondrejsevcik
Copy link

Hi, I'm using karma with preprocessor for typescript and since this 8a30cf5 commit its not possible to use typescript files with default .ts extension.
c__windows_system32_cmd exe - node node_modules_karma_bin_karma start config_ka_2014-03-26_15-30-31

@drkibitz
Copy link

See 3rd string in this line https://github.com/karma-runner/karma/blob/master/lib/preprocessor.js#L21

I was worried about extension collisions in the back of my mind @vojtajina, and here is one, is it a "Transport Stream" or "TypeScript" file? This is where something like mime-magic can help, but it is quite a large dependency to introduce. There's gotta be a better way to do this :/

@dignifiedquire
Copy link
Member

@drkibitz
Copy link

@dignifiedquire I like it, have you tried it?

@dignifiedquire
Copy link
Member

Yes I've been using it in production without problems for over a month now.

@drkibitz
Copy link

Would like @vojtajina to weigh in before a pull request ;)

@vojtajina
Copy link
Contributor

Can somebody do a benchmark of isbinaryfile? Compare to just checking the path as we do now? Because for the purpose of Karma, in 99.9% time it's not a binary file. And if you preprocess thousands of files I dont' wanna slow it down.

As a quick fix for now, I would remove the ts from binary extensions.

@ondrejsevcik
Copy link
Author

I've created simple benchmark https://github.com/ondrejsevcik/isbinaryfile-benchmark

It tests a few npm packages, but I'm not 100% sure that this test is adequate so please check it out.
Results are below
screen shot 2014-04-19 at 09 00 23

@vojtajina
Copy link
Contributor

Fixed by 8269852.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants