一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
67 行
962 B
TypeScript
67 行
962 B
TypeScript
import errorsHaveChanged from './errorsHaveChanged';
|
|
import { ImportErrors } from './types';
|
|
|
|
describe('errorsHaveChanged', () => {
|
|
|
|
test('should tell if an errors object has changed', () => {
|
|
const testCases: [ImportErrors, ImportErrors, boolean][] = [
|
|
[
|
|
{
|
|
'one': '111',
|
|
'two': '222',
|
|
},
|
|
{
|
|
'two': '222',
|
|
'one': '111',
|
|
},
|
|
false,
|
|
],
|
|
[
|
|
{
|
|
'one': '111',
|
|
'two': '222',
|
|
},
|
|
{
|
|
'one': '111',
|
|
'two': '222',
|
|
},
|
|
false,
|
|
],
|
|
[
|
|
{
|
|
'one': '111',
|
|
'two': '222',
|
|
},
|
|
{
|
|
'one': '111',
|
|
},
|
|
true,
|
|
],
|
|
[
|
|
{
|
|
'one': '111',
|
|
'two': '222',
|
|
},
|
|
{
|
|
'one': '222',
|
|
'two': '111',
|
|
},
|
|
true,
|
|
],
|
|
[
|
|
{},
|
|
{},
|
|
false,
|
|
],
|
|
];
|
|
|
|
for (const t of testCases) {
|
|
const [oldErrors, newErrors, expected] = t;
|
|
|
|
const result = errorsHaveChanged(oldErrors, newErrors);
|
|
expect(result).toBe(expected);
|
|
}
|
|
});
|
|
|
|
});
|