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

mkdirp module does not respect fs manual mock #1571

Closed
skevy opened this issue Sep 1, 2016 · 3 comments
Closed

mkdirp module does not respect fs manual mock #1571

skevy opened this issue Sep 1, 2016 · 3 comments

Comments

@skevy
Copy link
Contributor

skevy commented Sep 1, 2016

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

When mocking fs and using mkdirp within your codebase, mkdirp doesn't use the fs mock.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal repository on GitHub that we can npm install and npm test.

https://github.com/skevy/jest-mkdirp-issue -- npm install && npm test, and then observe that 1) the test fails and 2) an actual directory is created in the folder that contains this repo.

What is the expected behavior?

Test should pass, and it should use the fake filesystem provided by the fs mock.

Run Jest again with --debug and provide the full configuration it prints. Please mention your node and npm version and operating system.

Node Version: 6.3.1
NPM Version: 3.10.3

jest version = 15.1.0
test framework = jasmine2
config = {
  "rootDir": "/Users/adam/Development/personal/projects/jest-mkdirp-issue",
  "name": "-Users-adam-Development-personal-projects-jest-mkdirp-issue",
  "setupFiles": [
    "/Users/adam/Development/personal/projects/jest-mkdirp-issue/node_modules/babel-polyfill/lib/index.js"
  ],
  "testRunner": "/Users/adam/Development/personal/projects/jest-mkdirp-issue/node_modules/jest-jasmine2/build/index.js",
  "scriptPreprocessor": "/Users/adam/Development/personal/projects/jest-mkdirp-issue/node_modules/babel-jest/build/index.js",
  "usesBabelJest": true,
  "preprocessorIgnorePatterns": [
    "/node_modules/"
  ],
  "automock": false,
  "bail": false,
  "browser": false,
  "cacheDirectory": "/var/folders/lx/3l8d75fd29v4pfg6l2jq017w0000gn/T/jest",
  "colors": false,
  "coveragePathIgnorePatterns": [
    "/node_modules/"
  ],
  "coverageReporters": [
    "json",
    "text",
    "lcov",
    "clover"
  ],
  "globals": {},
  "haste": {
    "providesModuleNodeModules": []
  },
  "mocksPattern": "__mocks__",
  "moduleDirectories": [
    "node_modules"
  ],
  "moduleFileExtensions": [
    "js",
    "json",
    "node"
  ],
  "moduleNameMapper": {},
  "modulePathIgnorePatterns": [],
  "noStackTrace": false,
  "notify": false,
  "preset": null,
  "resetModules": false,
  "testEnvironment": "jest-environment-jsdom",
  "testPathDirs": [
    "/Users/adam/Development/personal/projects/jest-mkdirp-issue"
  ],
  "testPathIgnorePatterns": [
    "/node_modules/"
  ],
  "testRegex": "(/__tests__/.*|\\.(test|spec))\\.js$",
  "testURL": "about:blank",
  "timers": "real",
  "useStderr": false,
  "verbose": null,
  "watch": false,
  "cache": true,
  "watchman": true,
  "testcheckOptions": {
    "times": 100,
    "maxSize": 200
  }
}
@skevy
Copy link
Contributor Author

skevy commented Sep 1, 2016

cc @cpojer

@cpojer
Copy link
Member

cpojer commented Sep 15, 2016

yay we fixed this. Nice work @skevy.

@cpojer cpojer closed this as completed Sep 15, 2016
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants