Other such faults are sometimes tested for, but usually only when there is a risk of inheriting them from a parent.
By contrast, the scientists say their new test would identify far more conditions, caused by genetic errors.
However, they warned it raised “many ethical questions” because the results could be used as a basis for abortion.
These concerns were last night amplified by pro-life campaigners, who said widespread use of such a test would “inevitably lead to more abortions”.
The American scientists were able to map the baby’s genetic code principally from tiny traces free-floating DNA, which makes its way into the mother’s blood.
Blood sample DNA from the mother was also studied as well as DNA extracted from the father's saliva.
Fitting pieces of the genetic jigsaw together, scientists in the US were able to reconstruct the entire genetic code of an unborn baby boy.
They were then able to see what spontaneous genetic mutations had arisen.
Such natural mutations - called ‘de novo’ mutations - are responsible for the majority of genetic defects.
By checking their prediction of the baby’s genetic code with actual DNA taken after the birth, the team from the University of Washington in Seattle, found they were able to identify 39 of 44 such mutations in the child.
De novo mutations are thought to play a role in a number of complex conditions such as autism and schizophrenia.
The team also tested their approach on a woman who was earlier in her pregnancy than 18 weeks, and found it still worked.
Dr Jay Shendure, the lead scientist, said: "This work opens up the possibility that we will be able to scan the whole genome of the foetus for more than 3,000 single-gene disorders through a single, non-invasive test."
Jacob Kitzman, who worked on the project, added: “The improved resolution is like going from being able to see that two books are stuck together to being able to notice one word mis-spelled on a page.”
In future, a more refined and less costly version of the procedure could make pre-natal genetic testing far more comprehensive than it is now, the scientists say.
The research is reported in the journal Science Translational Medicine.
The scientists said the test would be a considerable improvement on current techniques, which involve inserting a probe into the womb to take fluid from the foetal sac or placental samples. This can be dangerous for both mother and child.
Such existing methods only enable doctors to check for a relatively small number of genetic disorders.
These include Down's syndrome and cystic fibrosis - which are both large-scale genetic defects - as well as muscular dystrophy and spina bifada, which can have hereditary elements.
As well as testing for thousands of genetic defects, the scientists said their test could give a wealth of information on the baby’s future health.
However, they warned: “The less tangible implication of incorporating this level of information into pre-natal decision-making raises many ethical questions that must be considered carefully within the scientific community and on a societal level.
“As in other areas of clinical genetics, our capacity to generate data is outstripping our ability to interpret it in ways that are useful to physicians and patients.”
Josephine Quintavalle, founder of the Pro-Life Alliance, put it more baldly.
She said: “One always hopes, vainly, that in utero testing will be for the benefit of the unborn child.
“But, whilst this new test may not itself be invasive, given our past track record, it is difficult to imagine that this new test will not lead to more abortions.”