The "unit" tests and "interactive" tests are not currently written in a understandable way. It also rely on execution orders of sync and async JSZhuyin and JSZhyinClient. This makes the API a little weak and make safely removal of all the complexity in JSZhuyinClient hard.
I think the right solution here is for all the automation, we would need a runner/wrapper that takes an array with a series of commands (and/or callbacks) in an array, and run them against a JSZhuyin/JSZhuyinClient instance. All the test should be rewrite to call that wrapper (and probably rewrite to be run in Mocha) so we can sure the program do the same thing in {JSZhuyin|JSZhuyinClient} in {Browser|NodeJS}.
The "unit" tests and "interactive" tests are not currently written in a understandable way. It also rely on execution orders of sync and async JSZhuyin and JSZhyinClient. This makes the API a little weak and make safely removal of all the complexity in JSZhuyinClient hard.
I think the right solution here is for all the automation, we would need a runner/wrapper that takes an array with a series of commands (and/or callbacks) in an array, and run them against a JSZhuyin/JSZhuyinClient instance. All the test should be rewrite to call that wrapper (and probably rewrite to be run in Mocha) so we can sure the program do the same thing in {JSZhuyin|JSZhuyinClient} in {Browser|NodeJS}.