-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It is always advisable to import individual packages, as it is much easier to track the breaking changes. Because we updated all the dependencies, numerous bug fixes, features, and breaking changes have been incorporated.
- Loading branch information
Showing
5 changed files
with
79 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import cheminfo from 'eslint-config-cheminfo'; | ||
import globals from 'globals'; | ||
|
||
export default [ | ||
...cheminfo, | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
}, | ||
rules: { | ||
// "camelcase": "off", | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,39 @@ | ||
/* eslint-disable import/namespace */ | ||
import { it, describe, expect } from 'vitest'; | ||
|
||
import * as ML from '..'; | ||
|
||
describe('Check all properties are defined', () => { | ||
const objectsAndNbKeys = { | ||
Distance: 42, | ||
Similarity: 11, | ||
Array: 11, | ||
ArrayXY: 10, | ||
BitArray: 12, | ||
KMeans: 2, | ||
HClust: 2, | ||
NaiveBayes: 2, | ||
CrossValidation: 6, | ||
FCNNLS: 2, | ||
MatrixLib: 36, | ||
GSD: 7, | ||
}; | ||
|
||
it.each(Object.keys(ML))('Check %s', (key) => { | ||
// if a function it should key should start with lowercase | ||
// if a class it should key should start with uppercase | ||
expect(ML[key]).toBeDefined(); | ||
|
||
if (objectsAndNbKeys[key]) { | ||
expect(typeof ML[key]).toBe('object'); | ||
expect(Object.keys(ML[key]).length).toBe(objectsAndNbKeys[key]); | ||
} else if (key[0] === key[0].toUpperCase()) { | ||
// should be a class | ||
expect(typeof ML[key]).toBe('function'); | ||
expect(typeof ML[key].prototype).toBe('object'); | ||
expect(ML[key].prototype?.constructor).toBe(ML[key]); | ||
} else { | ||
// should be function | ||
expect(typeof ML[key]).toBe('function'); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters