Thursday, 9 June 2016

TypeError: (0 , _chai.expect)(...).toBe is not a function

Error while running Mocha tests:

TypeError: (0 , _chai.expect)(...).toBe is not a function


By doing some research, came to see that I need to use a different syntax while using 'chai'

By changing my test cases as below got worked.

expect(true).to.be.true;
expect(false).to.be.false;

Thank You,
Uma Mahesh.


Wednesday, 8 June 2016

jsdom

A JavaScript implementation of the DOM and HTML standards

Install:
$ npm install jsdom

 Its much more like DOM

its mainly used for testing 

Its creates a virtual DOM.. there is no browser and no selenium scripts... 





Thank You,
Uma Mahesh.

get latest code and rebase to local branch



> git branch

> git checkout develop

To fetch all remote branches.
> git fetch origin

To rebase local develop branch with remote develop branch.
> git rebase origin/develop

> git checkout <your branch>

to rebase local branch with develop branch
> git rebase develop


Thank You,
Uma Mahesh.







Tuesday, 7 June 2016

command to delete remote branch from git

Here is the command to delete branch from remote repo in git


> git push origin --delete <Branch name>


This will delete branch from local machine as well as remote repo.

Thank You,
Uma Mahesh.
 

Monday, 15 February 2016

Git push asking for username and password

When I try to push the code to github, I need to submit username and password every time. I keep on asking for username and password while pushing the code.

I came to see its due to ssh.

I have checked my remote config of my git repo and came to see it was with https

>    git remote –v
Now I removed the remote repo which is with https as below
>    git remote rm origin

Now I added the remote repo with git as below
>    git remote add origin git@github.com:umamahesh/sampleapp.git

Now authentication happens without ssh and with keys. You can push the code without username and password.

Thank You,
Uma Mahesh.

get code from remote branch in git

When you want to pull the branch code from same  repo, first navigate to main branch. Main branch is the reference branch.

>     git checkout master

From the main branch checkout to ‘develop’ branch. Develop branch is the name of the remote branch I am referring to.
>    git checkout develop
>    git pull origin develop
Now you will get the latest code from develop branch.

Below are the steps to merge the code from your branch to develop branch.

Let’s suppose you are working on the branch ‘uma-development’, Now you want to merge your code to ‘develop’ branch.

>    git checkout uma-development
>    git rebase develop

you may see many conflicts while doing the rebase. Try to solve conflicts one by one… after solving the conflicts, do git add
>    git add.
>    git rebase –continue

once your conflicts got resolved you are done with rebase. Now your branch ‘uma-development ‘ is up to date with develop branch code.

Now push the code to develop branch in remote and then raise pull request to develop branch.




Thanks,
Uma Mahesh.