Does mocha Test Have Cache Phenomenon? Or is there a hidden file on the mac?

  node.js, question

Today, I was writing a test case: I read the contents of a generated file all morning, but I just didn’t read it, and I still didn’t read it at night. From whether there was a bug in the code I read, to spelling check, to path change, I didn’t solve this problem, and nobody answered the question after inside threw it out in several forums.

The following is a strange question: Does mac inside have invisible files?

This is the file directory:
QQ20150430-4@2x.png

This is the configured path:
var config = {
promiseData:’../data/promiseData.json’,
asyncData:’../data/asyncData.json’,
eventproxyData:’../data/eventproxyData.json’
bracket

I found that the configuration mode was the same, but the test cases could always read promiseData data, and the latter two could not read it, either synchronously or asynchronously. This was very strange. Later, I opened wide and renamed all the file directories and even deleted the Data directory. I found that the test cases could still read promiseData data! ! ! why?

Later, I grabbed the data again and generated a new data directory and internal data files. I found that the test cases read the data once stored in promiseData at a certain time. According to this situation, I would like to ask everyone, is there cache for mocha tests? Or is there a hidden file in mac inside, and the test case has been accessing the hidden file data in the past? ? ?

The program can run through, but the test cannot run because of the path.

For a require module, the path is relative to the module itself

For the execution file with fs, the path needs to be referenced and set according to the specific command of Command.

Simply put, executing files in different locations will affect the file path of fs.

Everyone should pay more attention to oh ~