Skip to content
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
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"root": true,
"ignorePatterns": "**/*.js",
"overrides": [
{
"files": "*.ts",
Expand Down
37 changes: 33 additions & 4 deletions .github/workflows/verify-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Verify build

on:
workflow_dispatch:
pull_request_target:
types: [opened, synchronize, reopened]

Expand Down Expand Up @@ -33,8 +34,22 @@ jobs:
- name: lint
run: npm run lint

test:
runs-on: ubuntu-20.04
test-chrome:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: install
run: npm ci

- name: test
run: npm run test -- --watch=false --browsers=Chrome

test-firefox:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -45,10 +60,24 @@ jobs:
run: npm ci

- name: test
run: npm run test -- --watch=false --browsers=ChromeHeadless
run: npm run test -- --watch=false --browsers=Firefox

test-safari:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: install
run: npm ci

- name: test
run: npm run test -- --watch=false --browsers=Safari

prettier:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"builder": "@angular-devkit/build-angular:karma",
"options": {
"tsConfig": "projects/angular-ecmascript-intl/tsconfig.spec.json",
"polyfills": ["zone.js", "zone.js/testing"]
"polyfills": ["zone.js", "zone.js/testing"],
"karmaConfig": "projects/angular-ecmascript-intl/karma.conf.js"
}
}
}
Expand Down
25 changes: 23 additions & 2 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-firefox-launcher": "^2.1.2",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"karma-safari-launcher": "^1.0.0",
"ng-packagr": "~16.1.0",
"prettier": "~3.0.0",
"typescript": "~5.1.0"
Expand Down
32 changes: 32 additions & 0 deletions projects/angular-ecmascript-intl/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = function (config) {
config.set({
basePath: "",
frameworks: ["jasmine", "@angular-devkit/build-angular"],
plugins: [
require("karma-jasmine"),
require("karma-chrome-launcher"),
require("karma-firefox-launcher"),
require("karma-safari-launcher"),
require("karma-jasmine-html-reporter"),
require("karma-coverage"),
require("@angular-devkit/build-angular/plugins/karma"),
],
client: {
clearContext: false,
},
jasmineHtmlReporter: {
suppressAll: true,
},
coverageReporter: {
dir: require("path").join(
__dirname,
"../../coverage/angular-ecmascript-intl",
),
subdir: ".",
reporters: [{ type: "html" }, { type: "text-summary" }],
},
reporters: ["progress", "kjhtml"],
browsers: ["Chrome"],
restartOnFileChange: true,
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ describe('IntlLanguagePipe', () => {
});
testUnit = TestBed.inject(IntlLanguagePipe);

expect(testUnit.transform('en-US', { locale: 'de-DE' })).toEqual(
'Englisch (Vereinigte Staaten)',
expect(testUnit.transform('de-DE', { locale: 'de-DE' })).toEqual(
'Deutsch (Deutschland)',
);
});
});