question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

test files are unexpectedly removed when edited by certain editors

See original GitHub issue

Using:

$ testacular --version
Testacular version: 0.5.5

It appears that, when saving, some editors (e.g vim) move the original file (to preserve it as a backup) and create a new file, rather than updating the file in place.

As a result Testacular (almost always) removes the edited file:

info (watcher): Removed file "/path/to//test/unit/controllersSpec.js".

Future changes to the file are no longer detected. Once is forced to restart Testacular.

Note, Testacular behaves normally (recognizing the file has been updated) when one simply touches the file:

$ touch test/unit/controllersSpec.js

A workaround is to specify an explicit file backup policy, i.e. in the vim case by adding :set backupcopy=yes to your ~/.vimrc:

"backupcopy                                                                     
"    "yes"   make a copy of the file and overwrite the original one             
"    "no"    rename the file and write a new one                                
"    "auto"  one of the previous, what works best                               
:set backupcopy=yes

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:28 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
rrytercommented, Aug 2, 2016

I just ran into this problem with karma 1.1.2 I can confirm disabling ‘safe write’ in Intellij “solves” the problem.

1reaction
s-o-r-o-u-s-hcommented, Mar 4, 2016

same issue with karma v0.13.21

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Google Docs, Sheets, Slides & Forms error ...
If you get an error message such as "Something went wrong. Reload" or "Unable to load file" preventing you from making edits on...
Read more >
File in use Error- Excel is locked for editing which is opened ...
1. Please open Excel, click File> Options> Save, under Cache Settings, tick the option “Delete files from the Office Document Cache when they ......
Read more >
What Causes a File to Suddenly Disappear?
Disappearing files may be corrupted, hidden, infected or moved.
Read more >
Common errors that may occur during editing—Help
You can receive an error message if you have no data sources that are editable, there is a licensing issue (such as attempting...
Read more >
[Solved] : How to Fix MS Excel Crash Issue
If Excel keeps crashing on your PC while opening a workbook, saving Excel file, scrolling or editing cells, etc., it indicates a problem ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found