[test] add tests
[fix] missing require()
[test] ensure factory is always called