[test] simplify test case for native modules using 'typeof'.