How to use correctly filtering on NightwatchJS - nightwatch.js

I'm using src_folders with filter to skip others .js files that don't match my patterns but he is skipping patterns files also:
Error: No tests defined! using source folder: test_fixtures
- using path filter: /*-spec.js

"src_folders" : ["test_fixtures"],
and
"filter": "**/*-spec.js",
works for me. Now i get all files located in test_fixtures/**/*-spec.js

Related

I am having directory issue or something I don't know

File 'd:/cypress/gitRepo3/CypressNonGit/node_modules/cypress/types' not found.
The file is in the program because:
Matched by include pattern './node_modules/cypress' in 'd:/cypress/gitRepo3/CypressNonGit/jsconfig.json'
I am trying to get autosuggestions into my cypress code, I guess (learning phase only)
I am getting this error when I include jsconfig.json whish is saying as above.
I using visual studio code 1.64.2
jsconfig.json
{
"include" :[
"./node_modules/cypress",
"cypress/**/*.js"
]
}
and this my project structure
Instead of [] user {}
like
"include" :{
"./node_modules/cypress",
"cypress/**/*.js"
}```

Transformation error ... parser plugin(s): 'decorators-legacy, decorators'

I get the following error when I run jscodeshift -t ./react-codemod/transforms/React-PropTypes-to-prop-types.js ./src
Transformation error (This experimental syntax requires enabling one of the following parser plugin(s): 'decorators-legacy, decorators' (13:0))
I googled a bit and found out I have to set the --parser-config of jscodeshift. I need help with a sample json file that can resolve the above error.
The instructions mentioned in the comment by The Third are correct.
I was need to manually update babel5Compat.js file with this 'decorators-legacy' plugin.
// in ./node_modules/jscodeshift/parser/babel5Compat.js
plugins: [
// a list of plugins,
'decorators-legacy',
]

Parcel Bundler - handle scss without resolving any urls in my sass

It's great that ParcelJS just handles sass out of the box but I'm running into a problem where it keeps throwing an exception when it encounters a url within in my scss file. I guess Parcel is trying to locate the resource and rewrite the url. I do not want Parcel to do this. Is there anyway to disable this? I just want it to compile the sass and leave any urls in there alone.
This question was posted when Parcel v1 was the latest version. For folks arriving here in the future, you can accomplish this in Parcel v2 with the parcel-resolver-ignore plugin. Here's how:
Install it (e.g. yarn add -D parcel-resolver-ignore)
Create or modify your .parcelrc file to add it to the parcel pipeline:
{
"extends": "#parcel/config-default",
"resolvers": ["parcel-resolver-ignore", "..."]
}
Add a "parcelIgnore" entry to package.json that contains regex patterns that define which resources to ignore, e.g.:
{
// An array of Regex patterns
"parcelIgnore": [
"images\/*.*",
]
}
The things you want to target your regexes to match are the urls referenced in the .scss files, not the .scss files themselves.

Laravel Mix and SASS changing font directory

I'm using Laravel 5.4 and Laravel Mix to output SASS files.
In my font definitions I'm configuring them so that when the CSS is output it will point to files such as public/assets/fnt/font-name/filename.ext but the processor changes the output so that it will instead point to public/fonts/filename.ext. Is there a way to stop it from changing the output paths?
It makes little sense to me that it would do something like this by default.
Edit
I've seen that the defaults they're using in Mix are the culprit:
module.exports.module = {
rules: [
// ...
{
test: /\.(woff2?|ttf|eot|svg|otf)$/,
loader: 'file-loader',
options: {
name: 'fonts/[name].[ext]?[hash]',
publicPath: '/'
}
}
]
};
I've tried using null-loader instead of file-loader but instead it causes it to fail because it can't find the files in node_modules which is not where it should be looking in the first place.
Removing the rule in question results in a flood of errors from trying to open and evaluate the font files in question:
error in ./public/assets/fnt/fanfare-jf/fanfare-jf.ttf
Module parse failed: DIRECTORY\public\assets\fnt\fanfare-jf\fanfare-jf.ttf Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
# ./~/css-loader!./~/postcss-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap&precision=8!./resources/assets/sass/app.scss 6:2525-2590
# ./resources/assets/sass/app.scss
# multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
I can at least add emitFiles: false to options to prevent it from making copies of the file, but the paths are still being altered.
I ended up with the following configuration to at least get it to a working state.
let assetDir = 'assets/build';
mix.config.fileLoaderDirs.fonts = `${assetDir}/${mix.config.fileLoaderDirs.fonts}`;
mix.config.fileLoaderDirs.images = `${assetDir}/${mix.config.fileLoaderDirs.images}`;
mix.sass('resources/sass/app.scss', `public/${assetDir}/css`)
.js('resources/js/app.js', `public/${assetDir}/js`);
Updated:
In newer versions this has been made customizable via mix.options() and can be adjusted as below:
let assetDir = 'assets/build';
mix.options({
fileLoaderDirs: {
images: `${assetDir}/img`,
fonts: `${assetDir}/fonts`
}
});
// adjust build commands accordingly, for example:
mix.js('resources/js/app.js', `public/${assetDir}/js`);
The output you got is the intended behaviour due to your configuration.
You are using this configuration to load the file:
options: {
name: 'fonts/[name].[ext]?[hash]',
publicPath: '/'
}
Which says use the publicPath as public and create a file with the name fonts/[name].[ext]?[hash] and webpack knows about what these symbols '/', '.', '?' in the name do.
It just looks for the fonts directory and if there is no any fonts directory it creates a new one and place the files into that directory.
So, you need to use this configuration for your folder structure:
options: {
name: 'assets/fnt/font-name/[name].[ext]?[hash]',
publicPath: '/'
}
This should work for your configuration.
More on file-loader configuration:
https://github.com/webpack-contrib/file-loader#filename-templates
Edit:
Since Laravel Mix uses Webpack in it's background and Webpack doesn't have any knowledge of the fonts file when there is no any appropriate loader added to the configuration. So, the error:
Module parse failed: DIRECTORY\public\assets\fnt\fanfare-jf\fanfare-jf.ttf Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type.
is occurred.
You need to tell the Webpack to load the fonts to your desired directory and the fonts linked in your SASS file will be linked by the Webpack without any more configurations.

ST2: SublimeLinter ignoring JSHint settings

I've been trying to configure SublimeLinter to use different JSHint settings, but my settings are being totally ignored. Mostly I just want to be able to use double quotes without getting a linting error. Here's what I have in my 'User' SublimeLinter.sublime-settings
{
"jshint_options":
{
"evil": true,
"regexdash": true,
"browser": true,
"wsh": true,
"sub": true,
"quotmark" : true
}
}
The file is definitely being parsed, as it throws an error whenever it's not properly formatted (amusingly this includes whenever the strings are wrapped in single quotes). It's also ignoring more than just the quote preference- I can set "evil" to false and it'll still give me eval warnings.
Any ideas? This is on OSX.
Thanks in advance.
FYI just in case: jshint_options is no longer available on SublimeLinter-jshint and settings are now set with .jshintrc files. See this and this.
I had the exact same problem. The default .jshintrc in "sublime/preferences/package settings/js hint/set linting preferences" did absolutely nothing for me either.
In order to fix it, I created a .jshintrc file in the root folder of the web project I was working on. I then opened the folder through sublime text and sublinter/jshint picked up my settings.
Maybe your Jshint options are overridden by a .jshinrc file. According to SublimeLinter README file :
SublimeLinter supports .jshintrc files. If using JSHint, SublimeLinter will recursively search the directory tree (from the file location to the file-system root directory). This functionality is specified in the JSHint README.
and
The jshint follows convention set by node-jshint (though node is not required) and will attempt to locate the configuration file for you starting in pwd. (or "present working directory") If this does not yield a .jshintrc file, it will move one level up (..) the directory tree all the way up to the filesystem root. If a file is found, it stops immediately and uses that set of configuration instead of "jshint_options".

Resources