Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(testing): move jest to nrwl devkit #4454

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

FrozenPandaz
Copy link
Collaborator

Current Behavior

Jest uses the Angular Devkit

Expected Behavior

Jest uses the Nrwl Devkit

Related Issue(s)

Fixes #

@FrozenPandaz FrozenPandaz force-pushed the migrate-jest branch 2 times, most recently from 4145035 to 201b4c2 Compare January 6, 2021 20:05
@nx-cloud
Copy link

nx-cloud bot commented Jan 6, 2021

Nx Cloud Report

CI ran the following commands for commit 3fa8432. Click to see the status, the terminal output, and the build insights.

Status Command Start Time
#000000 nx run-many --target=build --all --parallel 1/8/2021, 7:29:57 PM
#000000 nx run-many --target=e2e --projects=e2e-node 1/8/2021, 7:30:57 PM

Sent with 💌 from NxCloud.

@FrozenPandaz FrozenPandaz force-pushed the migrate-jest branch 11 times, most recently from d64e062 to 76c1a1c Compare January 7, 2021 18:05
Copy link
Member

@vsavkin vsavkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments, but overall looks good. Once addressed, you can merge the changes.

@@ -18,3 +18,16 @@ export function readJson<T = any>(host: Tree, path: string) {
throw new Error(`Cannot parse ${path}: ${e.message}`);
}
}

export function writeJson<T = any>(host: Tree, path: string, val: T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add API docs

host.write(path, JSON.stringify(val, null, 2));
}

export function updateJson<T = any, U = T>(

This comment was marked as resolved.

import { installPackagesTask } from '../tasks/install-packages-task';

/**
* Add Dependencies and Dev Dependencies to package.json and queue an npm install if necessary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd not use the word queue cause we aren't queueing anything. Maybe say and returns a task that runs npm installs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also add a small example

/**
* Add Dependencies and Dev Dependencies to package.json and queue an npm install if necessary
*/
export function addDependenciesToPackageJson(

This comment was marked as resolved.

/**
* This reads a `migration.json` file and makes appropriate updates to dependency versions.
*/
export function updatePackagesInPackageJson(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hsoul dnot be required, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function was only needed for ng update, not for nx migrate

export type StringChange = StringInsertion | StringDeletion;

/**
* Use this to queue changes a string's original value and replay them
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function doesn't queue anything (especially given that you resort the changes) and it doesn't really "replay" stuff. I'd change it as applies a list of changes to a string and describe when it is needed. The position is being moved etc.

d: 'DELETE',
};

class AdapterTree {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rename it to show the direction of the wrapping. The reason is that we have so many things wrapping other things to make this integration seamless that I get lost. Something like NxDevkitTreeWrappingAngularDevkitTree.

const installTask = updateDependencies(tree, options);
removeNrwlJestFromDeps(tree);
updateExtensions(tree);
if (installTask) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also do return installTask

@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants