Comments (9)
Released as part of 0.4.2. Please re-open if the problem persists.
from karma-viewport.
Can you provide your karma config?
from karma-viewport.
Here's most of the config. At one point I'd explicitly set client.useIframe
and viewport.context
but it didn't seem to make a difference.
config.set({
basePath: '..',
plugins: [
'karma-mocha',
'karma-webpack',
'karma-chrome-launcher',
'karma-phantomjs-launcher',
'karma-sinon-chai',
'karma-mocha-reporter',
'karma-junit-reporter',
'karma-sourcemap-loader',
'karma-viewport'
],
// Hack to workaround https://github.com/squidfunk/karma-viewport/issues/29.
beforeMiddleware: [
'viewport',
],
frameworks: ['mocha', 'sinon-chai', 'viewport'],
files: [
'test/index.js'
],
exclude: [
],
preprocessors: {
'test/index.js': ['webpack']
},
webpack: webpackTestConfig,
webpackMiddleware: {
progress: true,
stats: true,
debug: true,
noInfo: false,
silent: false
},
client: {
mocha: {
reporter: 'HTML',
timeout: 30000
}
},
mochaReporter: {
showDiff: true
},
junitReporter: {
outputDir: 'reports/karma'
},
reporters: ['mocha'],
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['Chrome'],
// karma-viewport
viewport: {
breakpoints: [
{
name: 'mobile',
size: {
width: 414,
height: 736
}
},
{
name: 'tablet',
size: {
width: 768,
height: 1024
}
}
]
},
singleRun: false,
concurrency: Infinity,
browserNoActivityTimeout: 120000,
});
from karma-viewport.
I'm sorry for not answering for so long. I'm currently on vacation and will look into it in the beginning of September.
from karma-viewport.
I have the same problem. Debugging the commit that broke this functionality yields the following results:
Line 62 in 194aa2e
config
is the global karma config object, not the framework specific config as the code assumes. karma's config setting 'context' is not specified. It should beconfig.viewport.context
.client
throws a reference error. It's supposed to beconfig.client.useIframe
.
As stated you can get around that by using:
config.set({
// ...
beforeMiddleware: ['viewport'],
})
Thanks for providing this plugin. It's super useful for testing CSS media selectors.
from karma-viewport.
Are you both sure that you are using the most recent version (0.4.1)? The code snippet both of you posted relate to a version below 0.4.0. There was indeed a bug in the comment you referenced. The current check negates the client.useIframe
property, which is correct and should make your code work:
Line 142 in fe92794
Furthermore note that in 0.4.0 the name of the property config.viewport.selector
was changed to config.viewport.context
.
from karma-viewport.
I'm sure. This is the current master and it's also what my local package shows. See the framework
method, deciding whether to push the middleware or not:
https://github.com/squidfunk/karma-viewport/blob/0.4.1/src/index.js#L62
The commit I referenced shows the point in time when the behaviour broke, not the most recent code. My previous comments and results also relate to the current version (0.4.1) of the plugin, sorry for the confusion.
from karma-viewport.
Ok, sorry, my fault, got the wrong line. This was indeed a copy and paste error. Will provide a fix asap.
from karma-viewport.
A fix is provided in #30 which removes the check. The beforeMiddleware
is now always registered which is even better and more extendable.
from karma-viewport.
Related Issues (12)
- Invalid file type warning HOT 8
- Viewport is not defined in Karma DEBUG RUNNER HOT 10
- No provider for "framework:viewport"! HOT 5
- Is there a good way to test scrolling within the viewport? HOT 3
- Error with PhantomJs HOT 1
- Getting the TypeScript typings to work HOT 25
- 404 for adapter sourcemap. HOT 2
- ReferenceError: viewport is not defined HOT 10
- Source map issues HOT 3
- No window resize event is triggered HOT 3
- Log4js Vulnerability HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karma-viewport.