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

Update nrf-device-lib-js to 0.4.6 #340

Merged
merged 1 commit into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 6.0.2 - 2022-04-28

### Changed

- Update `nrf-device-lib-js` to 0.4.6.

## 6.0.1 - 2022-04-11

### Changed
Expand Down
44 changes: 22 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pc-nrfconnect-shared",
"version": "6.0.1",
"version": "6.0.2",
"description": "Shared commodities for developing pc-nrfconnect-* packages",
"repository": {
"type": "git",
Expand Down Expand Up @@ -36,7 +36,7 @@
"@babel/preset-typescript": "7.16.7",
"@electron/remote": "^2.0.4",
"@mdi/font": "3.9.97",
"@nordicsemiconductor/nrf-device-lib-js": "0.4.4",
"@nordicsemiconductor/nrf-device-lib-js": "0.4.6",
"@reduxjs/toolkit": "1.8.0",
"@svgr/webpack": "5.5.0",
"@swc/core": "1.2.148",
Expand Down
36 changes: 24 additions & 12 deletions src/Device/DeviceSelector/DeviceSelector.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,30 @@ import DeviceSelector from './DeviceSelector';
jest.mock('../sdfuOperations', () => ({}));

const testDevice: Device = {
id: 1,
hwInfo: {
romSize: 123,
ramSize: 456,
romPageSize: 789,
deviceFamily: 'PCATest',
deviceVersion: 'PCATest',
},
broken: null,
usb: {
serialNumber: '000000001',
manufacturer: 'testManufacturer',
product: 'testProduct',
device: {
busNumber: 2,
address: 3,
descriptor: {
bDescriptorType: 4,
idVendor: 5,
idProduct: 6,
},
configurations: [],
},
},
serialNumber: '000000001',
serialPorts: [
{
Expand Down Expand Up @@ -56,7 +80,6 @@ const testDevice: Device = {
comName: 'COM1',
},
favorite: false,
// @ts-expect-error The DeviceTraits type was wrong, but will be fixed by https://github.com/NordicPlayground/nrf-device-lib-js/pull/104
traits: {
jlink: true,
},
Expand All @@ -83,7 +106,6 @@ describe('DeviceSelector', () => {
it('should have no device selected by default', () => {
const { getByText } = render(
<DeviceSelector
// @ts-expect-error The DeviceTraits type was wrong, but will be fixed by https://github.com/NordicPlayground/nrf-device-lib-js/pull/104
deviceListing={{
nordicUsb: true,
serialPort: true,
Expand All @@ -98,7 +120,6 @@ describe('DeviceSelector', () => {
it('should show no connected devices', () => {
const { getByText } = render(
<DeviceSelector
// @ts-expect-error The DeviceTraits type was wrong, but will be fixed by https://github.com/NordicPlayground/nrf-device-lib-js/pull/104
deviceListing={{
nordicUsb: true,
serialPort: true,
Expand All @@ -114,7 +135,6 @@ describe('DeviceSelector', () => {
it('should list connected devices', () => {
const { getByText } = render(
<DeviceSelector
// @ts-expect-error The DeviceTraits type was wrong, but will be fixed by https://github.com/NordicPlayground/nrf-device-lib-js/pull/104
deviceListing={{
nordicUsb: true,
serialPort: true,
Expand All @@ -130,7 +150,6 @@ describe('DeviceSelector', () => {
it('should unlist disconnected devices', () => {
const { queryByText } = render(
<DeviceSelector
// @ts-expect-error The DeviceTraits type was wrong, but will be fixed by https://github.com/NordicPlayground/nrf-device-lib-js/pull/104
deviceListing={{
nordicUsb: true,
serialPort: true,
Expand All @@ -146,7 +165,6 @@ describe('DeviceSelector', () => {
it('should show more device info when selecting the expand button', () => {
const { getByText, getByTestId, getAllByText } = render(
<DeviceSelector
// @ts-expect-error The DeviceTraits type was wrong, but will be fixed by https://github.com/NordicPlayground/nrf-device-lib-js/pull/104
deviceListing={{
nordicUsb: true,
serialPort: true,
Expand All @@ -164,7 +182,6 @@ describe('DeviceSelector', () => {
it('can select connected devices', () => {
const { getAllByText, getByText } = render(
<DeviceSelector
// @ts-expect-error The DeviceTraits type was wrong, but will be fixed by https://github.com/NordicPlayground/nrf-device-lib-js/pull/104
deviceListing={{
nordicUsb: true,
serialPort: true,
Expand All @@ -183,7 +200,6 @@ describe('DeviceSelector', () => {
it('can deselect selected devices', async () => {
const { getAllByText, getByText, findByTestId, getByTestId } = render(
<DeviceSelector
// @ts-expect-error The DeviceTraits type was wrong, but will be fixed by https://github.com/NordicPlayground/nrf-device-lib-js/pull/104
deviceListing={{
nordicUsb: true,
serialPort: true,
Expand All @@ -204,7 +220,6 @@ describe('DeviceSelector', () => {
it('should allow device selection when custom devices are enabled and no valid firmware is defined', () => {
const { queryByText, getAllByText, getByText } = render(
<DeviceSelector
// @ts-expect-error The DeviceTraits type was wrong, but will be fixed by https://github.com/NordicPlayground/nrf-device-lib-js/pull/104
deviceListing={{
nordicUsb: true,
serialPort: true,
Expand Down Expand Up @@ -234,7 +249,6 @@ describe('DeviceSelector', () => {
it('should deselect device when custom devices are disabled and no valid firmware is defined', async () => {
const { getByText, getAllByText, queryByText } = render(
<DeviceSelector
// @ts-expect-error The DeviceTraits type was wrong, but will be fixed by https://github.com/NordicPlayground/nrf-device-lib-js/pull/104
deviceListing={{
nordicUsb: true,
serialPort: true,
Expand Down Expand Up @@ -270,7 +284,6 @@ describe('DeviceSelector', () => {
it('should show firmware prompt when a valid firmware is defined', async () => {
const { getByText } = render(
<DeviceSelector
// @ts-expect-error The DeviceTraits type was wrong, but will be fixed by https://github.com/NordicPlayground/nrf-device-lib-js/pull/104
deviceListing={{
nordicUsb: true,
serialPort: true,
Expand All @@ -295,7 +308,6 @@ describe('DeviceSelector', () => {
it('should select device when cancelling firmware prompt', async () => {
const { getByText, getAllByText, findByText } = render(
<DeviceSelector
// @ts-expect-error The DeviceTraits type was wrong, but will be fixed by https://github.com/NordicPlayground/nrf-device-lib-js/pull/104
deviceListing={{
nordicUsb: true,
serialPort: true,
Expand Down
9 changes: 0 additions & 9 deletions src/Device/deviceLister.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,8 @@ export const stopWatchingDevices = () => {
}
};

// @ts-expect-error This is how the nrfdl-js api works at the moment.
const DEFAULT_TRAITS: DeviceTraits = {
serialPort: true,
// usb: false,
// nordicUsb: false,
// nordicDfu: false,
// seggerUsb: false,
// jlink: false,
// broken: false,
// mcuboot: false,
// modem: false,
};

/**
Expand Down
8 changes: 0 additions & 8 deletions src/Device/sdfuOperations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,17 +427,9 @@ const prepareInDFUBootloader = async (
)
);

// @ts-expect-error This is how the nrfdl-js api works at the moment.
return waitForDevice(device.serialNumber, DEFAULT_DEVICE_WAIT_TIME, {
serialPort: true,
nordicUsb: true,
// broken: false,
// jlink: false,
// mcuboot: false,
// modem: false,
// nordicDfu: false,
// seggerUsb: false,
// usb: false,
});
};

Expand Down