Skip to content

Commit

Permalink
update some deps, tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
bassner committed Jun 13, 2022
1 parent 4a0f91d commit c0aa9e8
Show file tree
Hide file tree
Showing 8 changed files with 14,170 additions and 21,715 deletions.
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ module.exports = {
},
},
},
testEnvironmentOptions: {
url: 'https://artemis.fake/test'
},
roots: ['<rootDir>', `<rootDir>/${baseUrl}`],
modulePaths: [`<rootDir>/${baseUrl}`],
setupFiles: ['jest-date-mock'],
Expand Down Expand Up @@ -63,7 +66,7 @@ module.exports = {
},
setupFilesAfterEnv: ['<rootDir>/src/test/javascript/spec/jest-test-setup.ts', 'jest-extended/all'],
moduleFileExtensions: ['ts', 'html', 'js', 'json', 'mjs'],
resolver: 'jest-preset-angular/build/resolvers/ng-jest-resolver.js',
resolver: '<rootDir>/jest.resolver.js',
transformIgnorePatterns: [`/node_modules/(?!${esModules})`],
transform: {
'^.+\\.(ts|js|mjs|html|svg)$': 'jest-preset-angular',
Expand Down
27 changes: 27 additions & 0 deletions jest.resolver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = (path, options) => {
// Call the defaultResolver, so we leverage its cache, error handling, etc.
return options.defaultResolver(path, {
...options,
// Use packageFilter to process parsed `package.json` before the resolution (see https://www.npmjs.com/package/resolve#resolveid-opts-cb)
packageFilter: pkg => {
// This is a workaround for https://github.com/uuidjs/uuid/pull/616
//
// jest-environment-jsdom 28+ tries to use browser exports instead of default exports,
// but uuid only offers an ESM browser export and not a CommonJS one. Jest does not yet
// support ESM modules natively, so this causes a Jest error related to trying to parse
// "export" syntax.
//
// This workaround prevents Jest from considering uuid's module-based exports at all;
// it falls back to uuid's CommonJS+node "main" property.
//
// Once we're able to migrate our Jest config to ESM and a browser crypto
// implementation is available for the browser+ESM version of uuid to use (eg, via
// https://github.com/jsdom/jsdom/pull/3352 or a similar polyfill), this can go away.
if (pkg.name === 'uuid') {
delete pkg['exports'];
delete pkg['module'];
}
return pkg;
},
});
};
35,794 changes: 14,110 additions & 21,684 deletions package-lock.json

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
"node_modules"
],
"dependencies": {
"@angular/animations": "14.0.0",
"@angular/cdk": "14.0.0",
"@angular/common": "14.0.0",
"@angular/compiler": "14.0.0",
"@angular/core": "14.0.0",
"@angular/forms": "14.0.0",
"@angular/localize": "14.0.0",
"@angular/material": "14.0.0",
"@angular/platform-browser": "14.0.0",
"@angular/platform-browser-dynamic": "14.0.0",
"@angular/router": "14.0.0",
"@angular/service-worker": "14.0.0",
"@angular/animations": "14.0.1",
"@angular/cdk": "14.0.1",
"@angular/common": "14.0.1",
"@angular/compiler": "14.0.1",
"@angular/core": "14.0.1",
"@angular/forms": "14.0.1",
"@angular/localize": "14.0.1",
"@angular/material": "14.0.1",
"@angular/platform-browser": "14.0.1",
"@angular/platform-browser-dynamic": "14.0.1",
"@angular/router": "14.0.1",
"@angular/service-worker": "14.0.1",
"@ctrl/ngx-emoji-mart": "6.2.0",
"@danielmoncada/angular-datetime-picker": "14.0.1",
"@fingerprintjs/fingerprintjs": "3.3.3",
Expand Down Expand Up @@ -51,7 +51,7 @@
"mobile-drag-drop": "2.3.0-rc.2",
"ngx-device-detector": "3.0.0",
"ngx-infinite-scroll": "13.0.2",
"ngx-webstorage": "9.0.0",
"ngx-webstorage": "10.0.1",
"papaparse": "5.3.2",
"process": "0.11.10",
"rxjs": "7.5.5",
Expand All @@ -78,13 +78,13 @@
}
},
"devDependencies": {
"@angular-builders/custom-webpack": "13.1.0",
"@angular-builders/jest": "13.0.4",
"@angular-devkit/build-angular": "14.0.0",
"@angular-eslint/eslint-plugin": "13.2.1",
"@angular/cli": "14.0.0",
"@angular/compiler-cli": "14.0.0",
"@angular/language-service": "14.0.0",
"@angular-builders/custom-webpack": "14.0.0-beta.0",
"@angular-builders/jest": "14.0.0-beta.0",
"@angular-devkit/build-angular": "14.0.1",
"@angular-eslint/eslint-plugin": "13.5.0",
"@angular/cli": "14.0.1",
"@angular/compiler-cli": "14.0.1",
"@angular/language-service": "14.0.1",
"@types/crypto-js": "4.1.1",
"@types/dompurify": "2.3.3",
"@types/jest": "28.1.1",
Expand All @@ -95,9 +95,9 @@
"@types/smoothscroll-polyfill": "0.3.1",
"@types/sockjs-client": "1.5.1",
"@types/uuid": "8.3.4",
"@typescript-eslint/eslint-plugin": "5.27.0",
"@typescript-eslint/eslint-plugin-tslint": "5.27.0",
"@typescript-eslint/parser": "5.27.0",
"@typescript-eslint/eslint-plugin": "5.27.1",
"@typescript-eslint/eslint-plugin-tslint": "5.27.1",
"@typescript-eslint/parser": "5.27.1",
"browser-sync": "2.27.10",
"browser-sync-webpack-plugin": "2.3.0",
"codelyzer": "6.0.2",
Expand All @@ -108,13 +108,13 @@
"eslint-webpack-plugin": "3.1.1",
"folder-hash": "4.0.2",
"husky": "7.0.4",
"jest": "28.1.0",
"jest": "28.1.1",
"jest-canvas-mock": "2.4.0",
"jest-date-mock": "1.0.8",
"jest-extended": "2.0.0",
"jest-junit": "13.2.0",
"jest-preset-angular": "12.1.0",
"lint-staged": "13.0.0",
"lint-staged": "13.0.1",
"merge-jsons-webpack-plugin": "2.0.1",
"ng-mocks": "13.5.2",
"prettier": "2.6.2",
Expand All @@ -126,7 +126,7 @@
"weak-napi": "2.0.2",
"webpack": "5.73.0",
"webpack-bundle-analyzer": "4.5.0",
"webpack-dev-server": "4.9.1",
"webpack-dev-server": "4.9.2",
"webpack-merge": "5.8.0",
"webpack-notifier": "1.15.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class ComplaintResponseService {

public convertDateFromClient(complaintResponse: ComplaintResponse): ComplaintResponse {
return Object.assign({}, complaintResponse, {
submittedTime: complaintResponse.submittedTime != undefined && dayjs(complaintResponse.submittedTime).isValid ? complaintResponse.submittedTime.toJSON() : undefined,
submittedTime: complaintResponse.submittedTime != undefined && dayjs(complaintResponse.submittedTime).isValid() ? complaintResponse.submittedTime.toJSON() : undefined,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/app/complaints/complaint.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class ComplaintService implements IComplaintService {

private convertDateFromClient(complaint: Complaint): Complaint {
return Object.assign({}, complaint, {
submittedTime: complaint.submittedTime && dayjs(complaint.submittedTime).isValid ? complaint.submittedTime.toJSON() : undefined,
submittedTime: complaint.submittedTime && dayjs(complaint.submittedTime).isValid() ? complaint.submittedTime.toJSON() : undefined,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class QuizParticipationComponent implements OnInit, OnDestroy {
disconnected = false;
unsavedChanges = false;

sendWebsocket: (submission: QuizSubmission) => void;
sendWebsocket?: (submission: QuizSubmission) => void;
showingResult = false;
userScore: number;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { textExerciseRoute } from 'app/exercises/text/manage/text-exercise/text-
import { TextExerciseComponent } from 'app/exercises/text/manage/text-exercise/text-exercise.component';
import { TextExerciseDetailComponent } from 'app/exercises/text/manage/text-exercise/text-exercise-detail.component';
import { ArtemisTeamConfigFormGroupModule } from 'app/exercises/shared/team-config-form-group/team-config-form-group.module';
import { ExternalSubmissionDialogComponent } from 'app/exercises/shared/external-submission/external-submission-dialog.component';
import { StructuredGradingCriterionModule } from 'app/exercises/shared/structured-grading-criterion/structured-grading-criterion.module';
import { AssessmentInstructionsModule } from 'app/assessment/assessment-instructions/assessment-instructions.module';
import { ExerciseDetailsModule } from 'app/exercises/shared/exercise/exercise-details/exercise-details.module';
Expand Down

0 comments on commit c0aa9e8

Please sign in to comment.