fix(testing): support loading css
This commit is contained in:
parent
04c6966f25
commit
268fe36ab6
@ -28,14 +28,6 @@ Type: `string`
|
|||||||
|
|
||||||
Dev server target to run tests against.
|
Dev server target to run tests against.
|
||||||
|
|
||||||
### headless
|
|
||||||
|
|
||||||
Default: `false`
|
|
||||||
|
|
||||||
Type: `boolean`
|
|
||||||
|
|
||||||
Whether or not to open the Cypress application to run the tests. If set to 'true', will run in headless mode
|
|
||||||
|
|
||||||
### exit
|
### exit
|
||||||
|
|
||||||
Default: `true`
|
Default: `true`
|
||||||
@ -44,6 +36,14 @@ Type: `boolean`
|
|||||||
|
|
||||||
Whether or not the Cypress Test Runner will stay open after running tests in a spec file
|
Whether or not the Cypress Test Runner will stay open after running tests in a spec file
|
||||||
|
|
||||||
|
### headless
|
||||||
|
|
||||||
|
Default: `false`
|
||||||
|
|
||||||
|
Type: `boolean`
|
||||||
|
|
||||||
|
Whether or not to open the Cypress application to run the tests. If set to 'true', will run in headless mode
|
||||||
|
|
||||||
### record
|
### record
|
||||||
|
|
||||||
Default: `false`
|
Default: `false`
|
||||||
|
|||||||
@ -22,7 +22,7 @@ describe('Jest', () => {
|
|||||||
const jestResult = await runCLIAsync(`test ${mylib}`);
|
const jestResult = await runCLIAsync(`test ${mylib}`);
|
||||||
expect(jestResult.stderr).toContain('Test Suites: 3 passed, 3 total');
|
expect(jestResult.stderr).toContain('Test Suites: 3 passed, 3 total');
|
||||||
done();
|
done();
|
||||||
}, 10000);
|
}, 45000);
|
||||||
|
|
||||||
it('should be able to generate a testable application using jest', async () => {
|
it('should be able to generate a testable application using jest', async () => {
|
||||||
ensureProject();
|
ensureProject();
|
||||||
@ -35,5 +35,5 @@ describe('Jest', () => {
|
|||||||
]);
|
]);
|
||||||
const jestResult = await runCLIAsync(`test ${myapp}`);
|
const jestResult = await runCLIAsync(`test ${myapp}`);
|
||||||
expect(jestResult.stderr).toContain('Test Suites: 3 passed, 3 total');
|
expect(jestResult.stderr).toContain('Test Suites: 3 passed, 3 total');
|
||||||
}, 10000);
|
}, 450000);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -23,6 +23,12 @@ describe('Web Applications', () => {
|
|||||||
newLib(`${libName} --framework react`);
|
newLib(`${libName} --framework react`);
|
||||||
|
|
||||||
const mainPath = `apps/${appName}/src/main.tsx`;
|
const mainPath = `apps/${appName}/src/main.tsx`;
|
||||||
|
updateFile(
|
||||||
|
`apps/${appName}/src/app/app.css`,
|
||||||
|
`body {
|
||||||
|
display: block;
|
||||||
|
}`
|
||||||
|
);
|
||||||
updateFile(mainPath, `import '@proj/${libName}';\n` + readFile(mainPath));
|
updateFile(mainPath, `import '@proj/${libName}';\n` + readFile(mainPath));
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${appName}`);
|
const lintResults = runCLI(`lint ${appName}`);
|
||||||
|
|||||||
@ -76,6 +76,7 @@ export function copyMissingPackages(): void {
|
|||||||
'jest',
|
'jest',
|
||||||
'@types/jest',
|
'@types/jest',
|
||||||
'jest-preset-angular',
|
'jest-preset-angular',
|
||||||
|
'identity-obj-proxy',
|
||||||
'karma',
|
'karma',
|
||||||
'karma-chrome-launcher',
|
'karma-chrome-launcher',
|
||||||
'karma-coverage-istanbul-reporter',
|
'karma-coverage-istanbul-reporter',
|
||||||
|
|||||||
@ -74,6 +74,7 @@
|
|||||||
"graphviz": "^0.0.8",
|
"graphviz": "^0.0.8",
|
||||||
"html-webpack-plugin": "^3.2.0",
|
"html-webpack-plugin": "^3.2.0",
|
||||||
"husky": "^1.0.0-rc.13",
|
"husky": "^1.0.0-rc.13",
|
||||||
|
"identity-obj-proxy": "3.0.0",
|
||||||
"ignore": "^5.0.4",
|
"ignore": "^5.0.4",
|
||||||
"jasmine-core": "~2.99.1",
|
"jasmine-core": "~2.99.1",
|
||||||
"jasmine-marbles": "0.4.0",
|
"jasmine-marbles": "0.4.0",
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
"@angular-devkit/build-webpack": "~0.13.1",
|
"@angular-devkit/build-webpack": "~0.13.1",
|
||||||
"copy-webpack-plugin": "4.6.0",
|
"copy-webpack-plugin": "4.6.0",
|
||||||
"fork-ts-checker-webpack-plugin": "0.4.9",
|
"fork-ts-checker-webpack-plugin": "0.4.9",
|
||||||
|
"identity-obj-proxy": "3.0.0",
|
||||||
"license-webpack-plugin": "^1.4.0",
|
"license-webpack-plugin": "^1.4.0",
|
||||||
"rxjs": "6.3.3",
|
"rxjs": "6.3.3",
|
||||||
"ts-loader": "5.3.1",
|
"ts-loader": "5.3.1",
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { dirname } from 'path';
|
import { dirname, extname } from 'path';
|
||||||
import * as ts from 'typescript';
|
import * as ts from 'typescript';
|
||||||
import defaultResolver from 'jest-resolve/build/defaultResolver';
|
import defaultResolver from 'jest-resolve/build/defaultResolver';
|
||||||
|
|
||||||
@ -37,6 +37,16 @@ function getCompilerSetup(rootDir: string) {
|
|||||||
let compilerSetup;
|
let compilerSetup;
|
||||||
|
|
||||||
module.exports = function(path: string, options: ResolveOptions) {
|
module.exports = function(path: string, options: ResolveOptions) {
|
||||||
|
const ext = extname(path);
|
||||||
|
if (
|
||||||
|
ext === '.css' ||
|
||||||
|
ext === '.scss' ||
|
||||||
|
ext === '.sass' ||
|
||||||
|
ext === '.less' ||
|
||||||
|
ext === '.styl'
|
||||||
|
) {
|
||||||
|
return require.resolve('identity-obj-proxy');
|
||||||
|
}
|
||||||
// Try to use the defaultResolver
|
// Try to use the defaultResolver
|
||||||
try {
|
try {
|
||||||
return defaultResolver(path, options);
|
return defaultResolver(path, options);
|
||||||
|
|||||||
10
yarn.lock
10
yarn.lock
@ -5184,6 +5184,10 @@ har-validator@~5.1.0:
|
|||||||
ajv "^5.3.0"
|
ajv "^5.3.0"
|
||||||
har-schema "^2.0.0"
|
har-schema "^2.0.0"
|
||||||
|
|
||||||
|
harmony-reflect@^1.4.6:
|
||||||
|
version "1.6.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/harmony-reflect/-/harmony-reflect-1.6.1.tgz#c108d4f2bb451efef7a37861fdbdae72c9bdefa9"
|
||||||
|
|
||||||
has-ansi@^2.0.0:
|
has-ansi@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
|
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
|
||||||
@ -5507,6 +5511,12 @@ iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4, ic
|
|||||||
dependencies:
|
dependencies:
|
||||||
safer-buffer ">= 2.1.2 < 3"
|
safer-buffer ">= 2.1.2 < 3"
|
||||||
|
|
||||||
|
identity-obj-proxy@3.0.0:
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz#94d2bda96084453ef36fbc5aaec37e0f79f1fc14"
|
||||||
|
dependencies:
|
||||||
|
harmony-reflect "^1.4.6"
|
||||||
|
|
||||||
ieee754@^1.1.4:
|
ieee754@^1.1.4:
|
||||||
version "1.1.12"
|
version "1.1.12"
|
||||||
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b"
|
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user