Pact vs PactWeb? - pact

I'm trying to use pact in an angular environment, with karma + jasmine test.
Looking for setup samples, I found two packages #pact-foundation/pact and #pact-foundation/pact-web. Both contain the same doc, version and git repo link.
Most of the sample seem to use
import { Pact } from '#pact-foundation/pact';
But some use
import { PactWeb } from '#pact-foundation/pact-web';
I didn't find any doc about PackWeb but karma/jasmine samples use it in pact github.
So, can someone explains what the difference ?
Thanks

Pact-web works in non-node based environments - e.g. Karma and Jasmine.
See our readme for more. https://github.com/pact-foundation/pact-js/blob/master/README.md#using-pact-in-non-node-environments

Related

Symfony 5 custom reusable bundle installation using flex - how to test and run a private recipe server

I have created a test reusable Symfony 5 bundle and have written a Flex recipe to automatically install and configure it within any project which is private.
My problem is, I have no idea how to run and test this. I cannot find any clear complete instructions anywhere. The official documentation does not specify how this would be done and only specifies how to create the manifest.json file.
https://github.com/symfony/recipes
I found the following info which specifies uploading the recipe to a private repository on GitHub and then activating Symfony Recipe Server for the repository which I have done.
https://blog.mayflower.de/6851-symfony-4-flex-private-recipes.html
but then what?
If understood this correctly, you want to add custom domain from where recipe would be downloaded and installed. Check this project:
Github https://github.com/moay/server-for-symfony-flex
Docs https://server-for-symfony-flex.readthedocs.io/en/latest/
Eventually you get to the point where you add custom endpoint from where to download the recipe like this:
Using the server in your Symfony project is as easy
as adding the proper endpoint to your composer.json:
{
...
"symfony": {
"endpoint": "https://your.domain.com"
}
}
I apologize if this is not in the desired format of an answer.

Flow-typed definitions being ignored in favor of npm module?

Consider the following Javascript and Flow code:
import type { $Request, $Response } from 'express';
function middleware(req: $Request, res: $Response) {}
middleware({}, {});
(full code at https://github.com/bradvogel/flow-playground)
When express isn't installed as an npm module, Flow correctly flags the code error:
However, when I npm install express, Flow can no longer resolve the types (from flow-typed):
Can someone explain who Flow is trying to import the types from the Express module, versus from flow-typed? How do I overcome this?
Flow doesn't really know about Node packages as a unit, so if you don't want Flow to try to parse things in node_modules, you'll want
[ignore]
<PROJECT_ROOT>/node_modules/.*
in your .flowconfig. If you did want to allow a subset of node_modules, the [ignore] explain how to do that.
I'm not aware of how Flow prioritizes explicitly-declared type definitions from flow-typed vs real files, but presumably given what we're seeing here, Flow must try to load type definitions from the actual imported file unless the file is ignored.

Unable to use FirebaseRecyclerAdapter

I am getting cannot resolve FirebaseRecyclerAdapter when trying to use it even after adding firebase ui in gradle dependency.Thanks in advance
I was getting the same issue, it's resolved by adding the firebase-ui dependency in build.gradle (module:app)
compile 'com.firebaseui:firebase-ui-database:0.4.0'
Also add the import in .java file where you're trying to declare it.
import com.firebase.ui.database.FirebaseRecyclerAdapter;
Go to build.gradle file, add a dependency (get the latest one from here https://github.com/firebase/FirebaseUI-Android)
The latest one on 5 October 2019 is implementation 'com.firebaseui:firebase-ui-database:6.0.2'
If You are facing Problem in 2020 then use this dependency:
implementation 'com.firebaseui:firebase-ui-database:6.0.2'
above mentioned answers are not working in today's date i have tried all of them,remember import this package too:
import com.firebase.ui.database.FirebaseRecyclerAdapter;
Can you show your build.gradle file?
Also, have you tried putting this under your package name in your java class: import com.firebase.ui.database.FirebaseRecyclerAdapter;?
In your app level gradle:add the following firebase dependency
dependencies {
compile'com.firebaseui:firebase-ui-database:1.1.1'
The dependencies quoted above don't seem to work anymore. After about an hour of searching online, I found this; hopefully it helps someone. It certainly fixed my problem:
compile 'com.firebaseui:firebase-ui:0.4.3'
Use exactly the matched version of FireBaseRecyclerAdapter
to the Versions that you have included in gradle for the Firebase Database.
This link will surely help you
https://github.com/firebase/FirebaseUI-Android
In this link, you will find the matched Firebase dependency according to the version.
I tried to import the following three packages, and my problem is solved:
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation 'com.firebaseui:firebase-ui-database:8.0.1'
implementation 'com.firebaseui:firebase-ui-database:1.2.0'
You can use this gradle dependencies

How do I compile LESS files every time I save a document?

I've installed Less via npm like this
$ npm install -g less
Now every time that I want to compile source files to .css, I run
$ lessc styles.less styles.css
Is there any way via the command line to make it listen when I save the document to compile it automatically?
The best solution out there I've found is the one recommended on the official LESS website: https://github.com/jgonera/autoless. It is dead simple to use. Also it listens to the changes in the imported files to compile.
Have a look at this article:
http://www.hongkiat.com/blog/less-auto-compile/
It offers GUI solutions (SimpLESS, WinLESS, LESS.app, and ChrunchApp) and a node solution. (deadsimple-less-watch-compiler)
Are you using less alone or with Node.JS ? Because if you are using it with node, there are easy ways to resolve this problem. The first two I can think of are (both these solutions go in your app.js) :
using a middleware, like stated in this stack overflow discussion
var lessMiddleware = require('less-middleware');
...
app.configure(function(){
//other configuration here...
app.use(lessMiddleware({
src : __dirname + "/public",
compress : true
}));
app.use(express.static(__dirname + '/public'));
});
another method consists of making a system call as soon as you start your nodeJS instance (the method name may differ based on your NodeJS version)
// before all the treatment is done
execSync("lessc /public/stylesheets/styles.less /public/stylesheets/styles.css");
var app = express();
app.use(...);
In both cases, Node will automatically convert the less files into css files. Note that with the second option, Node was to be relaunched for the conversion to happen, whereas the first option will answer your need better, by always checking for a newer version in a given directory.

Grunt : JASMINE is not supported anymore

i created an angular application with yeoman, when i executed grunt command i got the following error
Running "karma:unit" (karma) task
WARN [config]: JASMINE is not supported anymore.
Please use `frameworks = ["jasmine"];` instead.
WARN [config]: JASMINE_ADAPTER is not supported anymore.
Please use `frameworks = ["jasmine"];` instead.
WARN [config]: LOG_INFO is not supported anymore.
Please use `karma.LOG_INFO` instead.
ERROR [config]: Config file must export a function!
module.exports = function(config) {
config.set({
// your config
});
};
how do i solve this error ?
It's just those two predefined terms (JASMINE and JASMINE_ADAPTER)
that should not be used any more. All you have to do is open the
config file ./config/karma.conf.js and comment out those terms and add
frameworks = ["jasmine"];.
Via Yasuhiro Yoshida
apart from #sheplu's answer, there are additional changes that need to be done in karma.conf.js, you can see it in https://gist.github.com/sivakumar-kailasam/6421378
this gist solves your problem of 'Config file must be a export a function!'
The official docs has these changes as well http://karma-runner.github.io/0.10/config/configuration-file.html

Resources