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

feat(component-tester): allow using class in withResources #100

Merged
merged 4 commits into from
May 7, 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
33 changes: 33 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"extends": ["plugin:@typescript-eslint/recommended"],
"ignorePatterns": [
"node_modules",
"dist",
"build",
".vscode",
"*.config.js",
".webpack",
"_warmup",
"**/*.js"
],
"plugins": [],
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module"
},
"rules": {
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"prefer-const": "off",
"@typescript-eslint/ban-types": "off"
}
}
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: main
on: [push]

jobs:

ci:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- run: npm ci
- run: npm run cut-release
23 changes: 0 additions & 23 deletions circle.yml

This file was deleted.

16 changes: 16 additions & 0 deletions doc/MAINTAINER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Workflow releasing a new version

1. Update: pull latest master with `git checkout master && git pull`
2. Cut release: Run `npm run cut-release`. Example:

```shell
# automatic versioning
npm run cut-release
# manual versioning
npm run cut-release -- -- --release-as minor
npm run cut-release -- -- --release-as 1.0.1-beta.1
```
3. Commit: `git add .` and then `git commit chore(release): prepare release XXX` where `XXX` is the new version
4. Tag: `git tag -a XXX` where `XXX` is the version
5. Push to remote repo: `git push --follow-tags`
6. Publish: Run `npm publish` to release the new version
2 changes: 1 addition & 1 deletion doc/api.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions doc/cleanup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const path = require('path').resolve(__dirname, 'api.json');
const content = JSON.stringify(require('./api.json'));

require('fs').writeFileSync(path, content, { encoding: 'utf-8' });
143 changes: 64 additions & 79 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,86 +1,71 @@
// Karma configuration
// Generated on Sun Aug 28 2016 19:03:27 GMT-0400 (Eastern Daylight Time)
const path = require('path');
const { AureliaPlugin } = require('aurelia-webpack-plugin');

var TemplateServerMiddlewareFactory = function (config) {
var TEMPLATE_REQUEST_REGEXP = /^\/base\/dist\/test\/.+\.html$/i;
return function (req, res, next) {
if(TEMPLATE_REQUEST_REGEXP.test(req.url)) {
req.url = req.url.replace(/^\/base\/dist\/test\//, '/base/');
}

next();
};
}

module.exports = function (config) {
module.exports = function(config) {
const browsers = config.browsers;
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine', 'requirejs'],

beforeMiddleware: ['template-server'],
plugins: config.plugins.concat([
{'middleware:template-server': ['factory', TemplateServerMiddlewareFactory]}
]),

// list of files / patterns to load in the browser
files: [
'dist/test/test/setup.js',
{ pattern: 'dist/test/**/*.js', included: false, watched: true },
{ pattern: '**/*.html', included: false, watched: true },
{ pattern: 'node_modules/**/*.js', included: false, watched: false },
],


// list of files to exclude
exclude: [],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
frameworks: ["jasmine"],
files: ["test/**/*.spec.ts"],
preprocessors: {
"test/**/*.spec.ts": ["webpack", "sourcemap"],
},
webpack: {
mode: "development",
entry: 'test/setup.ts',
watch: false,
resolve: {
extensions: [".ts", ".js"],
modules: ["src", 'test', "node_modules"].map(m => path.resolve(__dirname, m)),
alias: {
src: path.resolve(__dirname, "src"),
test: path.resolve(__dirname, 'test'),
'aurelia-testing': path.resolve(__dirname, 'src/aurelia-testing.ts')
}
},
devtool: browsers.indexOf('ChromeDebugging') > -1 ? 'eval-source-map' : 'inline-source-map',
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
exclude: /node_modules/,
options: {
compilerOptions: {
sourceMap: true
}
}
},
{
test: /\.html$/i,
loader: 'html-loader'
}
]
},
plugins: [
new AureliaPlugin({ aureliaApp: undefined, dist: 'es2015' })
]
},
mime: {
"text/x-typescript": ["ts"]
},
reporters: ["mocha"],
webpackServer: { noInfo: config.noInfo },
browsers: browsers && browsers.length > 0 ? browsers : ['ChromeHeadless'],
customLaunchers: {
ChromeDebugging: {
base: "Chrome",
flags: ["--remote-debugging-port=9333"],
debug: true
}
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
})
}
mochaReporter: {
ignoreSkipped: true
},
webpackMiddleware: {
logLevel: 'silent'
},
});
};
Loading