To answer your question directly - no, I don't believe either is an anti-pattern when used correctly.
--- More verbose answer ---
From my experience, I think this depends heavily on the goal of your test. Here's the rule of thumb I've used in the past and it's helped me decide:
Are you actually testing a small unit of code? (A true unit test)
If yes, then I've found it's much easier to create the data inside the test itself exactly because I can see what is being passed in. In these cases, I will usually look for a Jasmine-like library to use because I find that it makes creating and maintaining the test data easier. That's a personal preference though - use whatever makes your job easier.
If no, then you're probably actually testing the system itself. In these cases, I often do load data from an external source, the reasons here being:
- This test isn't about code clarity for programmers (although that is still important - someone has to maintain this), it's about running enough different types of data through the entire chunk of the system to be reasonably sure it works.
- Often I will write the plumbing code to load and use the test data, but the data itself is created by someone else (usually a QA staff member in my case). These people aren't usually programmers so I can't expect them to be editing code.
So long answer short, it depends on what you're testing and why. Both approaches are useful and have their place - choose what works best for your situation.