Stub code for singleton.
yarn add @jswork/next-stub-singletonimport "@jswork/next-stub-singleton"; class Person { constructor(public name) { this.name = name; } } Object.assign(Person, nx.stubSingleton()); const app = (Person as unknown as SingletonType).getInstance("abc"); console.log(app);Code released under the MIT license.