Open KissBalazs opened 3 years ago
Manually installing
npm i -D ts-loader
and npm i -D angular2-template-loader
seems to solve the immediate issue with the error message.
However, my tests now produce "Expected 'styles' to be an array of strings."
I have tried to fix the issue by my webpack
knowledge is quite short.
changed
{
test: /(\.scss|\.sass)$/,
exclude: [/node_modules/, /\.global\.scss$/],
use: ['raw-loader', 'sass-loader'],
},
to
{
test: /(\.scss|\.sass)$/,
exclude: [/node_modules/, /\.global\.scss$/],
use: ['to-string-loader', 'css-loader', 'sass-loader']
},
But now I have other errors ("The template specified for component AppComponent is not a string") so I gave up for now :(
My testfile is the same from the tutorial:
import { initEnv, mount } from 'cypress-angular-unit-test';
import { AppComponent } from '../../src/app/app.component';
describe('AppComponent', () => {
it('shows the input', () => {
// Init Angular stuff
cy.log("start")
initEnv(AppComponent);
cy.log("1")
// You can also :
// initEnv({declarations: [AppComponent]});
// initEnv({imports: [MyModule]});
// component + any inputs object
mount(AppComponent, { title: 'World' });
// use any Cypress command afterwards
cy.contains('Welcome to World!');
});
});
Hi @KissBalazs,
Keep raw-loader, you need to install v1 : "raw-loader": "1.0.0"
I will improve ReadMe, thanks for your feedback !
Current behavior
After a fresh install, and following th tutorial, running the
npx cypress open-ct
results in a big error, and even though I can see the test cases, clicking on them won't run them.log:
Versions