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

TypeError: fs.readdirSync is not a function #155

Closed
cookpete opened this issue Apr 25, 2016 · 2 comments
Closed

TypeError: fs.readdirSync is not a function #155

cookpete opened this issue Apr 25, 2016 · 2 comments

Comments

@cookpete
Copy link

Since 5dc127d I have been getting errors when testing:

TypeError: fs.readdirSync is not a function. (In 'fs.readdirSync(rootPath)', 'fs.readdirSync' is undefined)

I am using karma-webpack and it looks like this line is causing the issue, as jasmine-core tries to use fs in the browser, which fails.

@jekill
Copy link

jekill commented Sep 11, 2016

@cookpete Hello.
I always get this error too.
Have you solved this problem?

@slackersoft
Copy link
Member

Jasmine-Ajax is probably loading the wrong thing when it is in a RequireJS environment to ensure that jasmine-core has already been initialized. The jasmine-core.js is there to boot up jasmine in a node environment (hence the fs calls) and thus shouldn't be used in a browser.

We would be happy to review a pull request (or set of them if something else is needed in core) to allow Jasmine-Ajax to require Jasmine-Core in RequireJS without NodeJS.

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

3 participants