nx-esbuild-decorators
Version:
The Nx Plugin for esbuild contains executors and generators that support building applications using esbuild and also supports decorators
24 lines (18 loc) • 677 B
text/typescript
import { readJson, writeJson, Tree } from '@nx/devkit';
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
import { esbuildInitGenerator } from './init';
describe('esbuildInitGenerator', () => {
let tree: Tree;
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
writeJson(tree, 'package.json', {});
});
it('should add esbuild as a dev dependency', async () => {
await esbuildInitGenerator(tree, {});
const packageJson = readJson(tree, 'package.json');
expect(packageJson.devDependencies).toEqual({
'@nx/esbuild': expect.any(String),
esbuild: expect.any(String),
});
});
});