when I run it on my local machine it works well ( MacOS, Linux ), but when I run it on CodeBuild
tests stops on calling of mockFS().
Bird-eye debugging showed, that tests become freeze in overrideBinding function in mock-fs/lib/index.js when it try override writeBuffer function.
function overrideBinding(binding) {
for (var key in binding) {
if (typeof binding[key] === 'function') {
// **TEST STOPS HERE WHEN KEY IS EQUAL writeBuffer**
realBinding[key] = binding[key].bind(binding);
} else {
realBinding[key] = binding[key];
}
}
}
So as result output of test on CodeBuild looks like
...
[Container] 2019/05/08 11:42:17 Running command npm run test
> mock-fs-test@1.0.0 test /codebuild/output/src540903502/src/git-codecommit.us-west-2.amazonaws.com/v1/repos/mock-fs-test
> NODE_ENV=test ./node_modules/mocha/bin/mocha --recursive test/**
mock-section
test runner
before
[Container] 2019/05/08 11:42:18 Phase complete: BUILD State: SUCCEEDED
...
First of all, thank you for this module. It is awesome!
I've faced with issue when trying to run tests that uses
mock-fs
on AWS CodeBuild.Node version: 10.14.1 mock-fs version: 4.7.0 ( 4.9.0 issue reproduced as well )
I have simple test:
when I run it on my local machine it works well ( MacOS, Linux ), but when I run it on CodeBuild tests stops on calling of mockFS(). Bird-eye debugging showed, that tests become freeze in
overrideBinding
function inmock-fs/lib/index.js
when it try overridewriteBuffer
function.So as result output of test on CodeBuild looks like
UPD. : There is really suitable tool to debug without AWS account https://aws.amazon.com/blogs/devops/announcing-local-build-support-for-aws-codebuild/ https://docs.aws.amazon.com/codebuild/latest/userguide/use-codebuild-agent.html
Thank you in advance!