Skip to content

Commit

Permalink
chore(repo): fix failing eslint test
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Apr 22, 2024
1 parent 0685f47 commit 9186a63
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ const rule2Name = 'my-rule';
describe('update-17-2-6-rename-workspace-rules', () => {
let tree: Tree;

beforeEach(() => {
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace();

const { lintWorkspaceRuleGenerator } = require('@nx/' +
'eslint/src/generators/workspace-rule/workspace-rule');

lintWorkspaceRuleGenerator(tree, {
await lintWorkspaceRuleGenerator(tree, {
name: rule1Name,
});
lintWorkspaceRuleGenerator(tree, {
await lintWorkspaceRuleGenerator(tree, {
name: rule2Name,
});

Expand All @@ -39,7 +39,7 @@ describe('update-17-2-6-rename-workspace-rules', () => {
},
});

update(tree);
await update(tree);

expect(Object.keys(readJson(tree, '.eslintrc.json').rules)).toEqual([
'@nx/workspace-test-rule',
Expand All @@ -61,7 +61,7 @@ describe('update-17-2-6-rename-workspace-rules', () => {
`
);

update(tree);
await update(tree);

expect(tree.read('custom.js', 'utf-8')).toContain(
`@nx/workspace-test-rule`
Expand Down Expand Up @@ -89,7 +89,7 @@ describe('update-17-2-6-rename-workspace-rules', () => {
`
);

update(tree);
await update(tree);

expect(tree.read('custom.js', 'utf-8')).toMatchInlineSnapshot(`
"import { getSourceNodes } from '@nx/workspace/src/utilities/typescript';
Expand Down Expand Up @@ -117,7 +117,7 @@ describe('update-17-2-6-rename-workspace-rules', () => {
`
);

update(tree);
await update(tree);

expect(tree.read('custom.js', 'utf-8')).not.toContain(
`@nx/workspace-random-rule`
Expand Down
5 changes: 5 additions & 0 deletions packages/jest/src/plugins/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ describe('@nx/jest/plugin', () => {
let createNodesFunction = createNodes[1];
let context: CreateNodesContext;
let tempFs: TempFs;
let cwd: string;

beforeEach(async () => {
tempFs = new TempFs('test');
cwd = process.cwd();
process.chdir(tempFs.tempDir);
context = {
nxJsonConfiguration: {
Expand All @@ -31,8 +33,11 @@ describe('@nx/jest/plugin', () => {
});
});

test('foo', () => {});

afterEach(() => {
jest.resetModules();
process.chdir(cwd);
});

it('should create nodes based on jest.config.ts', async () => {
Expand Down

0 comments on commit 9186a63

Please sign in to comment.