compare the type of window in order to avoid nodejs conflicts with test

This PR compares the type of window in order to avoid nodejs conflicts with test